diff --git a/README.md b/README.md index c8a4c3f..06b01da 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,12 @@ Behaviors : UI : * cursor : display mode "cursor" | default=gauge. * thickness : gauge thickness. +* lineCap : gauge stroke endings. | default=butt, round=rounded line endings * width : dial width. * displayInput : default=true | false=hide input. * displayPrevious : default=false | true=displays the previous value with transparency. * fgColor : foreground color. +* inputColor : input value (number) color. * bgColor : background color. Hooks diff --git a/js/jquery.knob.js b/js/jquery.knob.js index d3a6026..5a83de5 100644 --- a/js/jquery.knob.js +++ b/js/jquery.knob.js @@ -92,11 +92,13 @@ || this.$.data('cursor') || 0, thickness : this.$.data('thickness') || 0.35, + lineCap : this.$.data('linecap') || 'butt', width : this.$.data('width') || 200, height : this.$.data('height') || 200, displayInput : this.$.data('displayinput') == null || this.$.data('displayinput'), displayPrevious : this.$.data('displayprevious'), fgColor : this.$.data('fgcolor') || '#87CEEB', + inputColor: this.$.data('inputcolor') || this.$.data('fgcolor') || '#87CEEB', inline : false, // Hooks @@ -540,6 +542,7 @@ this.cursorExt = this.o.cursor / 100; this.xy = this.w2; this.lineWidth = this.xy * this.o.thickness; + this.lineCap = this.o.lineCap; this.radius = this.xy - this.lineWidth / 2; this.o.angleOffset @@ -574,7 +577,7 @@ ,'background' : 'none' ,'font' : 'bold ' + ((this.o.width / s) >> 0) + 'px Arial' ,'text-align' : 'center' - ,'color' : this.o.fgColor + ,'color' : this.o.inputColor || this.o.fgColor ,'padding' : '0px' ,'-webkit-appearance': 'none' }) @@ -604,6 +607,8 @@ c.lineWidth = this.lineWidth; + c.lineCap = this.lineCap; + this.o.cursor && (sat = eat - this.cursorExt) && (eat = eat + this.cursorExt);