knob: fix negative radius when knob size is too low (fixes #42)
This commit is contained in:
parent
ea0c89b6da
commit
c89846b208
1 changed files with 1 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ module.exports = class Knob extends _sliders_base {
|
|||
this.ctx.fill()
|
||||
|
||||
if ( this.colors.raised){
|
||||
var grd=this.ctx.createRadialGradient(this.width / 2, this.height / 2, r - 4 * PXSCALE , this.width / 2, this.height / 2, r)
|
||||
var grd=this.ctx.createRadialGradient(this.width / 2, this.height / 2, Math.max(r - 4 * PXSCALE, PXSCALE), this.width / 2, this.height / 2, r)
|
||||
grd.addColorStop(0, 'transparent')
|
||||
grd.addColorStop(1, this.colors.raised)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue