From 4aa557bcdbfa39d0674afdc86f3b87aabd7a6687 Mon Sep 17 00:00:00 2001 From: Paulo Menezes Date: Sat, 4 Jan 2020 18:25:05 -0300 Subject: [PATCH] Fix resizing when leaves windows --- src/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index df80cd0f1..83bf8fa1f 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1231,8 +1231,10 @@ class App extends React.Component<{}, AppState> { const el = this.state.resizingElement; const selectedElements = elements.filter(el => el.isSelected); if (selectedElements.length === 1) { - const x = e.clientX - target.offsetLeft - this.state.scrollX; - const y = e.clientY - target.offsetTop - this.state.scrollY; + const x = + e.clientX - CANVAS_WINDOW_OFFSET_LEFT - this.state.scrollX; + const y = + e.clientY - CANVAS_WINDOW_OFFSET_TOP - this.state.scrollY; selectedElements.forEach(element => { switch (resizeHandle) { case "nw":