ensure correct slide position on zoom reset after pan
This commit is contained in:
parent
0e8545f864
commit
77fe4e4fd6
@ -396,10 +396,10 @@ export default Whiteboard = React.memo(function Whiteboard(props) {
|
|||||||
if (maxY > scaledHeight) {
|
if (maxY > scaledHeight) {
|
||||||
nextCamera.y += maxY - scaledHeight;
|
nextCamera.y += maxY - scaledHeight;
|
||||||
}
|
}
|
||||||
if (nextCamera.x > 0 || minX < 0) {
|
if (nextCamera.x > 0 || minX < 0 || zoomValueRef.current === HUNDRED_PERCENT) {
|
||||||
nextCamera.x = 0;
|
nextCamera.x = 0;
|
||||||
}
|
}
|
||||||
if (nextCamera.y > 0 || minY < 0) {
|
if (nextCamera.y > 0 || minY < 0 || zoomValueRef.current === HUNDRED_PERCENT) {
|
||||||
nextCamera.y = 0;
|
nextCamera.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user