Skip to content

Commit

Permalink
feat(control): opt code
Browse files Browse the repository at this point in the history
  • Loading branch information
singlecoder committed Jun 8, 2021
1 parent 47c8267 commit 6f11a70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/controls/src/OrthoControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export class OrthoControl extends Script {

if (this._isPanStart) {
const { _panStart: panStart, _panEnd: panEnd } = this;
Vector2.subtract(panEnd, panStart, this._panDelta);
const panDelta = this._panDelta;
Vector2.subtract(panEnd, panStart, panDelta);
if (panDelta.x === 0 && panDelta.y === 0) {
return ;
}
this._handlePan();
panEnd.cloneTo(panStart);
}
Expand Down

0 comments on commit 6f11a70

Please sign in to comment.