mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: scale constrained area based on zoom
This commit is contained in:
parent
b4e80b602d
commit
edf54d1543
1 changed files with 6 additions and 4 deletions
|
@ -292,13 +292,15 @@ const isViewportOutsideOfConstrainedArea = (state: AppState) => {
|
|||
return false;
|
||||
}
|
||||
|
||||
const { scrollX, scrollY, width, height, scrollConstraints } = state;
|
||||
const { scrollX, scrollY, width, height, scrollConstraints, zoom } = state;
|
||||
|
||||
return (
|
||||
scrollX > scrollConstraints.x ||
|
||||
scrollX - width < scrollConstraints.x - scrollConstraints.width ||
|
||||
scrollY < scrollConstraints.y ||
|
||||
scrollY + height > scrollConstraints.y + scrollConstraints.height
|
||||
scrollX - width <
|
||||
scrollConstraints.x - scrollConstraints.width * zoom.value ||
|
||||
scrollY > scrollConstraints.y ||
|
||||
scrollY - height <
|
||||
scrollConstraints.y - scrollConstraints.height * zoom.value
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue