range: colorKnob

This commit is contained in:
jean-emmanuel 2024-02-18 15:35:17 +01:00
parent 476f07ec60
commit dfcf158808
3 changed files with 7 additions and 6 deletions

View file

@ -10,7 +10,7 @@
- dropdown: allow resubmitting the same value
- plot: missing `logScaleX` and `logScaleY` properties
- xy/multixy: add `axisLock` property; allow locking one the axis by holding `Shift` while dragging if `axisLock` is not set, bypasses it otherwise.
- fader: add `colorKnob` property
- knob/fader/range: add `colorKnob` property
## 1.25.7

View file

@ -18,6 +18,7 @@ module.exports = class Encoder extends StaticProperties(Knob, {angle: 360, range
pips: null,
dashed: null,
angle: null,
colorKnob: null
},
class_specific: {
origin: null,

View file

@ -299,7 +299,7 @@ class Range extends Fader {
// flat knob
this.ctx.globalAlpha = 1
this.ctx.fillStyle = this.cssVars.colorFill
this.ctx.fillStyle = this.cssVars.colorKnob
var compactAdjust = 1 / (height - this.gaugePadding) * (height-this.gaugePadding - knobHeight)
this.ctx.beginPath()
@ -331,7 +331,7 @@ class Range extends Fader {
this.ctx.fill()
this.ctx.globalAlpha = this.cssVars.alphaStroke
this.ctx.strokeStyle = this.cssVars.colorStroke
this.ctx.strokeStyle = this.cssVars.colorKnob
this.ctx.lineWidth = PXSCALE
this.ctx.beginPath()
@ -341,7 +341,7 @@ class Range extends Fader {
}
this.ctx.globalAlpha = 1
this.ctx.fillStyle = this.cssVars.colorWidget
this.ctx.fillStyle = this.cssVars.colorKnob
this.ctx.beginPath()
this.ctx.rect(m - knobWidth / 6, _d, knobWidth / 3, PXSCALE)
@ -354,7 +354,7 @@ class Range extends Fader {
} else {
this.ctx.globalAlpha = 1
this.ctx.fillStyle = this.cssVars.colorFill
this.ctx.fillStyle = this.cssVars.colorKnob
this.ctx.beginPath()
this.ctx.arc(m, d, knobHeight / 6, 0, 2 * Math.PI)
@ -368,7 +368,7 @@ class Range extends Fader {
if (this.cssVars.alphaStroke) {
this.ctx.globalAlpha = this.cssVars.alphaStroke
this.ctx.fillStyle = this.cssVars.colorFill
this.ctx.fillStyle = this.cssVars.colorKnob
this.ctx.beginPath()
this.ctx.arc(m, d, knobHeight / 2, 0, 2 * Math.PI)