Browse Source

check if pointer actually moved

Alexander Rose 5 years ago
parent
commit
b533542792
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/mol-util/input/input-observer.ts

+ 2 - 1
src/mol-util/input/input-observer.ts

@@ -6,7 +6,7 @@
 
 import { Subject, Observable } from 'rxjs';
 
-import { Vec2 } from '../../mol-math/linear-algebra';
+import { Vec2, EPSILON } from '../../mol-math/linear-algebra';
 
 import { BitFlags, noop } from '../../mol-util';
 
@@ -474,6 +474,7 @@ namespace InputObserver {
             if (dragging === DraggingState.Stopped) return
 
             Vec2.div(pointerDelta, Vec2.sub(pointerDelta, pointerEnd, pointerStart), getClientSize(rectSize))
+            if (Vec2.magnitude(pointerDelta) < EPSILON) return
 
             const isStart = dragging === DraggingState.Started
             const [ dx, dy ] = pointerDelta