mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add width, height as props to App.tsx (#1871)
This commit is contained in:
parent
b1261eea70
commit
9351b2821c
9 changed files with 184 additions and 27 deletions
|
@ -29,8 +29,8 @@ function isOutsideViewPort(
|
|||
window.devicePixelRatio,
|
||||
);
|
||||
return (
|
||||
viewportX2 - viewportX1 > window.innerWidth ||
|
||||
viewportY2 - viewportY1 > window.innerHeight
|
||||
viewportX2 - viewportX1 > appState.width ||
|
||||
viewportY2 - viewportY1 > appState.height
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ export const calculateScrollCenter = (
|
|||
const centerY = (y1 + y2) / 2;
|
||||
|
||||
return {
|
||||
scrollX: normalizeScroll(window.innerWidth / 2 - centerX),
|
||||
scrollY: normalizeScroll(window.innerHeight / 2 - centerY),
|
||||
scrollX: normalizeScroll(appState.width / 2 - centerX),
|
||||
scrollY: normalizeScroll(appState.height / 2 - centerY),
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue