fix: scale constrained area based on zoom
This commit is contained in:
parent
b4e80b602d
commit
edf54d1543
@ -292,13 +292,15 @@ const isViewportOutsideOfConstrainedArea = (state: AppState) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { scrollX, scrollY, width, height, scrollConstraints } = state;
|
const { scrollX, scrollY, width, height, scrollConstraints, zoom } = state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
scrollX > scrollConstraints.x ||
|
scrollX > scrollConstraints.x ||
|
||||||
scrollX - width < scrollConstraints.x - scrollConstraints.width ||
|
scrollX - width <
|
||||||
scrollY < scrollConstraints.y ||
|
scrollConstraints.x - scrollConstraints.width * zoom.value ||
|
||||||
scrollY + height > scrollConstraints.y + scrollConstraints.height
|
scrollY > scrollConstraints.y ||
|
||||||
|
scrollY - height <
|
||||||
|
scrollConstraints.y - scrollConstraints.height * zoom.value
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user