mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
need to clip the bounds of the layer. and fix issue with dragging the paint node :S
This commit is contained in:
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
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user