We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb3f48c commit 9c6ae95Copy full SHA for 9c6ae95
dist/index.html
@@ -2714,7 +2714,18 @@ <h2 class="export__title">${paletteTitle}</h2>
2714
}
2715
2716
if (e.key === 'p') {
2717
- lastSelectedPoint = poline.addAnchorPoint({xyz: [lastX, lastY, lastY]});
+ // Clamp position to be within the hue wheel (circle with radius 0.5 centered at 0.5, 0.5)
2718
+ let px = lastX;
2719
+ let py = lastY;
2720
+ const dx = px - 0.5;
2721
+ const dy = py - 0.5;
2722
+ const dist = Math.hypot(dx, dy);
2723
+ if (dist > 0.5) {
2724
+ // Project to edge of circle
2725
+ px = 0.5 + (dx / dist) * 0.5;
2726
+ py = 0.5 + (dy / dist) * 0.5;
2727
+ }
2728
+ lastSelectedPoint = poline.addAnchorPoint({xyz: [px, py, py]});
2729
updateSVG();
2730
updateFullCode();
2731
0 commit comments