Skip to content

Commit fe06f1d

Browse files
fix center-of logic with offset subtraction
1 parent fa34c77 commit fe06f1d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

editor-packages/editor-canvas/math/center-of.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ export function centerOf(
6363
vbcenter[1] - boxcenter[1] * scale,
6464
];
6565

66+
// apply viewbound's offset to the translate.
67+
// (this works, but not fully tested)
68+
translate[0] -= viewbound[0];
69+
translate[1] -= viewbound[1];
70+
6671
return {
6772
box: box,
6873
center: boxcenter,

0 commit comments

Comments
 (0)