Skip to content

Commit

Permalink
fixed NPEs on selection area
Browse files Browse the repository at this point in the history
  • Loading branch information
kleber-swf committed Dec 5, 2021
1 parent b5bcddd commit 0d4d45d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/editor-view/selectors/selection-area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,25 @@ export class SelectionArea extends HTMLElement {

private onMouseMove(e: MouseEvent) {
if (!this._mouseIsDown) return;

if (!this._isDragging) {
this._isDragging = true;
if (!this._hasSelection) {
this._hasSelection = this.selectionHandler.selectAt(e);
if (this._hasSelection && !this._handler) {
this._handler = this.handlers[GIZMO_MOVE];
}
}
if (this._hasSelection) {
this._handler.startHandling(e, this.selection.object);
this.gizmo.startMoving();
return;
}
}
this._handler.handle(e);

if (this._handler) {
this._handler.handle(e);
}
}

// #endregion
Expand Down

0 comments on commit 0d4d45d

Please sign in to comment.