knob: swaggify compact gauge (link alpha & distance to origin)
This commit is contained in:
parent
4066f0446e
commit
70b3e71568
1 changed files with 2 additions and 1 deletions
|
|
@ -162,7 +162,7 @@ Knob.prototype.draw = function(){
|
|||
this.ctx.arc(this.width / 2, this.height / 2, this.minDimension / 2 - (this.gaugeWidth + this.margin) * PXSCALE, min, max)
|
||||
this.ctx.stroke()
|
||||
|
||||
this.ctx.globalAlpha = 0.3
|
||||
this.ctx.globalAlpha = 0.2 + 0.2 * Math.abs(d-o) / (d<o?o-min:max-o)
|
||||
this.ctx.beginPath()
|
||||
this.ctx.strokeStyle = this.colors.gauge
|
||||
this.ctx.arc(this.width / 2, this.height / 2, this.minDimension / 2 - (this.gaugeWidth + this.margin) * PXSCALE, Math.min(o,d), Math.max(o,d))
|
||||
|
|
@ -174,6 +174,7 @@ Knob.prototype.draw = function(){
|
|||
this.ctx.arc(this.width / 2, this.height / 2, this.minDimension / 2 - (this.gaugeWidth/2 + this.margin) * PXSCALE, min, max)
|
||||
this.ctx.stroke()
|
||||
|
||||
|
||||
this.ctx.globalAlpha = 1
|
||||
|
||||
this.ctx.beginPath()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue