need to clip the bounds of the layer. and fix issue with dragging the paint node :S

This commit is contained in:
CrossPr0duct committed 2025-06-19 17:04:09 -04:00
1 parent c6e93508e4
commit 4c666fb2ff
1 file changed
+4 -4
@@ -134,17 +134,17 @@ export const PaintSurface = ({
y: number;
}): { x: number; y: number } => {
return {
x: Math.max(0, Math.min(point.x, leftPanelWidth)),
y: Math.max(0, Math.min(point.y, leftPanelHeight)),
x: Math.max(0, Math.min(point.x, store.getAspectRatioDimensions().width)), //leftPanelWidth)),
y: Math.max(0, Math.min(point.y, store.getAspectRatioDimensions().height))//leftPanelHeight)),
};
};
const isWithinLeftPanel = (point: { x: number; y: number }): boolean => {
return (
point.x >= 0 &&
point.x <= leftPanelWidth &&
point.x <= store.getAspectRatioDimensions().width && //leftPanelWidth &&
point.y >= 0 &&
point.y <= leftPanelHeight
point.y <= store.getAspectRatioDimensions().height // leftPanelHeight
);
};