source: [view]
dojo.provide('dojox.widget.gauge.AnalogArcIndicator');
dojo.require('dojox.widget.AnalogGauge');
dojo.experimental("dojox.widget.gauge.AnalogArcIndicator");
dojo.declare("dojox.widget.gauge.AnalogArcIndicator",[dojox.widget.gauge.AnalogLineIndicator],{
_createArc: function(val){
// Creating the Arc Path string manually. This is instead of creating new dojox.gfx.Path object
// each time since we really just need the Path string (to use with setShape) and we don't want to
// have to redo the connects, etc.
if(this.shapes[0]){
var a = this._gauge._getRadians(this._gauge._getAngle(val));
var cosa = Math.cos(a);
var sina = Math.sin(a);
var sa = this._gauge._getRadians(this._gauge.startAngle);
var cossa = Math.cos(sa);
var sinsa = Math.sin(sa);
var off = this.offset + this.width;
var p = ['M'];
p.push(this._gauge.cx+this.offset*sinsa);
p.push(this._gauge.cy-this.offset*cossa);
p.push('A', this.offset, this.offset, 0, ((a-sa)>Math.PI)?1:0, 1);
p.push(this._gauge.cx+this.offset*sina);
p.push(this._gauge.cy-this.offset*cosa);
p.push('L');
p.push(this._gauge.cx+off*sina);
p.push(this._gauge.cy-off*cosa);
p.push('A', off, off, 0, ((a-sa)>Math.PI)?1:0, 0);
p.push(this._gauge.cx+off*sinsa);
p.push(this._gauge.cy-off*cossa);
this.shapes[0].setShape(p.join(' '));
this.currentValue = val;
}