fix: fixed detecting viewport outside of constraints
This commit is contained in:
parent
9bc874a61e
commit
82aa1cf19d
@ -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…
x
Reference in New Issue
Block a user