Added color reducer. Performed state management refactor to prevent circular behavior.

This commit is contained in:
Jay
2025-08-06 14:26:55 -04:00
parent c27a5258d3
commit e011bd0763
21 changed files with 2592 additions and 799 deletions
+14
View File
@@ -11,12 +11,22 @@ function TestSquare() {
const [dimensions, setDimensions] = useState<CartesianSpace>({ x: 0, y: 0 });
const [xPosition, setXPosition] = useState(0);
const [yPosition, setYPosition] = useState(0);
const [xValue, setXValue] = useState(0);
const [yValue, setYValue] = useState(0);
const xValueRange = { min: 0, max: 100 };
const yValueRange = { min: 0, max: 100 };
const { crosshairRef, isDragging } = useCrosshair({
origin,
dimensions,
setXPosition,
setYPosition,
xValue,
yValue,
setXValue,
setYValue,
xValueRange,
yValueRange,
});
const boundaryRef = useRef<HTMLDivElement>(null);
@@ -98,6 +108,10 @@ function TestSquare() {
{isDragging ? "True" : "False"}
</span>
</p>
<p>
X Value: <span data-cy="x-value-display">{xValue}</span>
<br />Y Value: <span data-cy="y-value-display">{yValue}</span>
</p>
</>
);
}