Fix slider regression caused by CanvasPointer (#347)

This commit is contained in:
filtered
2024-11-27 05:05:24 +11:00
committed by GitHub
parent c61b08af8f
commit ffa2a24cb1

View File

@@ -2518,6 +2518,7 @@ export class LGraphCanvas {
if (widget.options.read_only) break
pointer.onDrag = (eMove) => {
const x = eMove.canvasX - node.pos[0]
const slideFactor = clamp((x - 15) / (width - 30), 0, 1)
widget.value = widget.options.min + (widget.options.max - widget.options.min) * slideFactor
if (oldValue != widget.value) {