From 4c666fb2ff06fc07bff2a08ba04671f2bf405de1 Mon Sep 17 00:00:00 2001 From: CrossPr0duct Date: Thu, 19 Jun 2025 17:04:09 -0400 Subject: [PATCH] need to clip the bounds of the layer. and fix issue with dragging the paint node :S --- .../apps/editor3d/app/src/pages/PageDraw/PaintSurface.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/apps/editor3d/app/src/pages/PageDraw/PaintSurface.tsx b/frontend/apps/editor3d/app/src/pages/PageDraw/PaintSurface.tsx index 3b76cf9dee..a34685a604 100644 --- a/frontend/apps/editor3d/app/src/pages/PageDraw/PaintSurface.tsx +++ b/frontend/apps/editor3d/app/src/pages/PageDraw/PaintSurface.tsx @@ -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 ); };