Преглед на файлове

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

David Sehnal преди 6 години
родител
ревизия
227aff3884
променени са 2 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 4 0
      src/mol-plugin/state/animation/manager.ts
  2. 1 1
      src/mol-plugin/util/canvas3d-identify.ts

+ 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);