mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: stop flooring scroll positions (#2883)
This commit is contained in:
parent
10cd6a24b0
commit
1973ae9444
10 changed files with 41 additions and 58 deletions
|
@ -1,11 +1,10 @@
|
|||
import { PointerCoords } from "./types";
|
||||
import { normalizeScroll } from "./scene";
|
||||
|
||||
export const getCenter = (pointers: Map<number, PointerCoords>) => {
|
||||
const allCoords = Array.from(pointers.values());
|
||||
return {
|
||||
x: normalizeScroll(sum(allCoords, (coords) => coords.x) / allCoords.length),
|
||||
y: normalizeScroll(sum(allCoords, (coords) => coords.y) / allCoords.length),
|
||||
x: sum(allCoords, (coords) => coords.x) / allCoords.length,
|
||||
y: sum(allCoords, (coords) => coords.y) / allCoords.length,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue