Permalink
Browse files

added option 'angleArc' || default = 360

'angleArc' define the angle of knob (in degree)
  • Loading branch information...
1 parent 5a4c1c4 commit 665bbb5598589d17e295395763ef778eb6c95433 @FabrizioC committed Jun 27, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 js/jquery.knob.js
View
5 js/jquery.knob.js
@@ -49,7 +49,7 @@ $(function () {
};
this.angle = function (nv) {
- return (nv - opt.min) * PI2 / (opt.max - opt.min);
+ return (nv - opt.min) * opt.angleArc / (opt.max - opt.min);
};
this.draw = function (nv) {
@@ -242,7 +242,8 @@ $(function () {
,'tickWidth' : $this.data('tickWidth') || 0.02
,'tickColorizeValues' : $this.data('tickColorizeValues') || true
,'skin' : $this.data('skin') || 'default'
- ,'angleOffset': degreeToRadians($this.data('angleoffset'))
+ ,'angleOffset': degreeToRadians($this.data('angleoffset'))
+ ,'angleArc': degreeToRadians($this.data('anglearc')) || 2 * Math.PI
// Hooks
,'draw' :

0 comments on commit 665bbb5

Please sign in to comment.