fader: implement touchZone for compact design

This commit is contained in:
jean-emmanuel 2025-02-28 12:48:58 +01:00
parent 9e4d1419e3
commit da3b7ff2d2

View file

@ -123,7 +123,8 @@ class Fader extends Slider {
horizontal = this.getProp('horizontal'),
snap = this.getProp('snap')
if (zone == 'all' || design == 'compact') return true
if (zone == 'all') return true
if (design == 'compact' && zone == 'gauge') return true
var x = e.offsetX,
y = e.offsetY,
@ -133,6 +134,8 @@ class Fader extends Slider {
knobHeight = this.cssVars.knobSize,
knobWidth = design ? knobHeight : knobHeight * .6
if (design == 'compact') knobWidth = this.width
if (horizontal) [knobWidth, knobHeight] = [knobHeight, knobWidth]
// add extra tolerance pixels