Fix #360 prevent creating invisibly small elements (#387)

pull/394/head
Günay Mert Karadoğan 5 years ago committed by Christopher Chedeau
parent 2a8e562e98
commit 4ecc734659

@ -982,6 +982,21 @@ export class App extends React.Component<{}, AppState> {
window.removeEventListener("mousemove", onMouseMove);
window.removeEventListener("mouseup", onMouseUp);
if (
elementType !== "selection" &&
draggingElement &&
draggingElement.width === 0 &&
draggingElement.height === 0
) {
// remove invisible element which was added in onMouseDown
elements = elements.slice(0, -1);
this.setState({
draggingElement: null
});
this.forceUpdate();
return;
}
resetCursor();
// If click occured on already selected element

Loading…
Cancel
Save