mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Master merge
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
b4d8b04d9e
commit
336fa9d002
21 changed files with 189 additions and 157 deletions
|
@ -11,16 +11,16 @@ import {
|
|||
tupleToCoors,
|
||||
viewportCoordsToSceneCoords,
|
||||
} from "../utils";
|
||||
import { point, type GlobalPoint } from "../../math";
|
||||
import { pointFrom, type GlobalPoint } from "../../math";
|
||||
|
||||
const isOutsideViewPort = (appState: AppState, cords: Array<number>) => {
|
||||
const [x1, y1, x2, y2] = cords;
|
||||
const [viewportX1, viewportY1] = sceneCoordsToViewportCoords(
|
||||
point(x1, y1),
|
||||
pointFrom(x1, y1),
|
||||
appState,
|
||||
);
|
||||
const [viewportX2, viewportY2] = sceneCoordsToViewportCoords(
|
||||
point(x2, y2),
|
||||
pointFrom(x2, y2),
|
||||
appState,
|
||||
);
|
||||
return (
|
||||
|
@ -77,7 +77,7 @@ export const calculateScrollCenter = (
|
|||
elements,
|
||||
tupleToCoors(
|
||||
viewportCoordsToSceneCoords(
|
||||
point(appState.scrollX, appState.scrollY),
|
||||
pointFrom(appState.scrollX, appState.scrollY),
|
||||
appState,
|
||||
),
|
||||
),
|
||||
|
@ -88,7 +88,7 @@ export const calculateScrollCenter = (
|
|||
const centerY = (y1 + y2) / 2;
|
||||
|
||||
return centerScrollOn({
|
||||
scenePoint: point(centerX, centerY),
|
||||
scenePoint: pointFrom(centerX, centerY),
|
||||
viewportDimensions: { width: appState.width, height: appState.height },
|
||||
zoom: appState.zoom,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue