Fix resizing when leaves windows

This commit is contained in:
Paulo Menezes 2020-01-04 18:25:05 -03:00
parent 83a53a24ec
commit 4aa557bcdb

View file

@ -1231,8 +1231,10 @@ class App extends React.Component<{}, AppState> {
const el = this.state.resizingElement; const el = this.state.resizingElement;
const selectedElements = elements.filter(el => el.isSelected); const selectedElements = elements.filter(el => el.isSelected);
if (selectedElements.length === 1) { if (selectedElements.length === 1) {
const x = e.clientX - target.offsetLeft - this.state.scrollX; const x =
const y = e.clientY - target.offsetTop - this.state.scrollY; e.clientX - CANVAS_WINDOW_OFFSET_LEFT - this.state.scrollX;
const y =
e.clientY - CANVAS_WINDOW_OFFSET_TOP - this.state.scrollY;
selectedElements.forEach(element => { selectedElements.forEach(element => {
switch (resizeHandle) { switch (resizeHandle) {
case "nw": case "nw":