fix: DOM widget position offset after canvas moves (#4557)

This commit is contained in:
Rizumu Ayaka
2025-07-29 16:40:47 +08:00
committed by GitHub
parent e7a425eeae
commit abf591d122
3 changed files with 55 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ export const useCanvasPositionConversion = (
canvasElement: Parameters<typeof useElementBounding>[0],
lgCanvas: LGraphCanvas
) => {
const { left, top } = useElementBounding(canvasElement)
const { left, top, update } = useElementBounding(canvasElement)
const clientPosToCanvasPos = (pos: Vector2): Vector2 => {
const { offset, scale } = lgCanvas.ds
@@ -31,6 +31,7 @@ export const useCanvasPositionConversion = (
return {
clientPosToCanvasPos,
canvasPosToClientPos
canvasPosToClientPos,
update
}
}