mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 06:48:12 +08:00
Fix pointer offset from viewport position
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { type Editor } from "@graphite/editor";
|
||||
|
||||
export function updateBoundsOfViewports(editor: Editor, container: HTMLElement) {
|
||||
const viewports = Array.from(container.querySelectorAll("[data-viewport-container]"));
|
||||
export function updateBoundsOfViewports(editor: Editor) {
|
||||
const viewports = Array.from(window.document.querySelectorAll("[data-viewport-container]"));
|
||||
const boundsOfViewports = viewports.map((canvas) => {
|
||||
const bounds = canvas.getBoundingClientRect();
|
||||
return [bounds.left, bounds.top, bounds.right, bounds.bottom];
|
||||
|
||||
Reference in New Issue
Block a user