From 6363c9886ed98642c3ec24fc9f6372fc04603b0e Mon Sep 17 00:00:00 2001 From: "Samuel M. Bednarz" Date: Sun, 4 Feb 2024 22:02:31 +0100 Subject: [PATCH] re-enable displaying saturation in hue bar --- packages/dye/components/Canvas/HueCanvas.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/dye/components/Canvas/HueCanvas.vue b/packages/dye/components/Canvas/HueCanvas.vue index ce83ae8..3c0fdd6 100644 --- a/packages/dye/components/Canvas/HueCanvas.vue +++ b/packages/dye/components/Canvas/HueCanvas.vue @@ -70,16 +70,17 @@ function fillHueCanvas(color: string = props.color.hex) { ctx.fillRect(0, 0, width, height) } +const { setMouseDown, offCanvas, isActiveCanvas } = useDyeStore() + watch( () => props.color.hex, (color) => { - console.log('color', mouseOn) - //fillHueCanvas(color) + const isActive = isActiveCanvas(hueCanvas.value) + if (!isActive) return + fillHueCanvas(color) } ) -const { setMouseDown, offCanvas, isActiveCanvas } = useDyeStore() - function hueChange(e: MouseEvent, click = false) { if (click) setMouseDown(true) if (offCanvas(e, click)) return