X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Toolkit.js;h=abdeb64c931f1c6171fff268407df41c703bb9fc;hb=61e428c29d0b551da06e286667f08c7b1a31befa;hp=d5761743f00dda8ef18485e9ecc669ed3d63932e;hpb=577b6c7546c5861ea7c0bd46b07825cd1b55c3cb;p=proxmox-widget-toolkit.git diff --git a/Toolkit.js b/Toolkit.js index d576174..abdeb64 100644 --- a/Toolkit.js +++ b/Toolkit.js @@ -208,6 +208,46 @@ Ext.define('EXTJS_23846.Gesture', { } }); +Ext.define('EXTJS_18900.Pie', { + override: 'Ext.chart.series.Pie', + + // from 6.0.2 + betweenAngle: function (x, a, b) { + var pp = Math.PI * 2, + offset = this.rotationOffset; + + if (a === b) { + return false; + } + + if (!this.getClockwise()) { + x *= -1; + a *= -1; + b *= -1; + a -= offset; + b -= offset; + } else { + a += offset; + b += offset; + } + + x -= a; + b -= a; + + // Normalize, so that both x and b are in the [0,360) interval. + x %= pp; + b %= pp; + x += pp; + b += pp; + x %= pp; + b %= pp; + + // Because 360 * n angles will be normalized to 0, + // we need to treat b === 0 as a special case. + return x < b || b === 0; + }, +}); + // we always want the number in x.y format and never in, e.g., x,y Ext.define('PVE.form.field.Number', { override: 'Ext.form.field.Number',