mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: fixed detecting viewport outside of constraints
This commit is contained in:
parent
9bc874a61e
commit
82aa1cf19d
1 changed files with 4 additions and 8 deletions
|
@ -328,18 +328,14 @@ const isViewportOutsideOfConstrainedArea = (state: AppState) => {
|
||||||
const scrollConstraints = alignScrollConstraints(inverseScrollConstraints);
|
const scrollConstraints = alignScrollConstraints(inverseScrollConstraints);
|
||||||
|
|
||||||
// Adjust scroll and dimensions according to the zoom level
|
// Adjust scroll and dimensions according to the zoom level
|
||||||
const adjustedScrollX = scrollX * zoom.value;
|
|
||||||
const adjustedScrollY = scrollY * zoom.value;
|
|
||||||
const adjustedWidth = width / zoom.value;
|
const adjustedWidth = width / zoom.value;
|
||||||
const adjustedHeight = height / zoom.value;
|
const adjustedHeight = height / zoom.value;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
adjustedScrollX > scrollConstraints.x ||
|
scrollX > scrollConstraints.x ||
|
||||||
adjustedScrollX - adjustedWidth <
|
scrollX - adjustedWidth < scrollConstraints.x - scrollConstraints.width ||
|
||||||
scrollConstraints.x - scrollConstraints.width ||
|
scrollY > scrollConstraints.y ||
|
||||||
adjustedScrollY > scrollConstraints.y ||
|
scrollY - adjustedHeight < scrollConstraints.y - scrollConstraints.height
|
||||||
adjustedScrollY - adjustedHeight <
|
|
||||||
scrollConstraints.y - scrollConstraints.height
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue