Browse Source

mol-plugin: temporary fix to disable mouse highlight/selection while animating

David Sehnal 6 years ago
parent
commit
227aff3884

+ 4 - 0
src/mol-plugin/state/animation/manager.ts

@@ -96,6 +96,10 @@ class PluginAnimationManager extends PluginComponent<PluginAnimationManager.Stat
         this.triggerUpdate();
     }
 
+    get isAnimating() {
+        return this.latestState.animationState === 'playing';
+    }
+
     private animate = async (t: number) => {
         if (this._current.startedTime < 0) this._current.startedTime = t;
         const newState = await this._current.anim.apply(

+ 1 - 1
src/mol-plugin/util/canvas3d-identify.ts

@@ -52,7 +52,7 @@ export class Canvas3dIdentifyHelper {
     }
 
     private animate: (t: number) => void = t => {
-        if (this.inside && t - this.prevT > 1000 / this.maxFps) {
+        if (!this.ctx.state.animation.isAnimating && this.inside && t - this.prevT > 1000 / this.maxFps) {
             this.prevT = t;
             this.currentIdentifyT = t;
             this.identify(false, t);