浏览代码

fix speed on IE

David Catuhe 7 年之前
父节点
当前提交
de91c05bb1
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      sandbox/index.js

+ 3 - 3
sandbox/index.js

@@ -114,9 +114,9 @@ if (BABYLON.Engine.isSupported()) {
             if (currentGroup != null && currentGroup.targetedAnimations[0].animation.runtimeAnimations[0] != null) {
                 var currentValue = slider.valueAsNumber;
                 var newValue = currentGroup.targetedAnimations[0].animation.runtimeAnimations[0].currentFrame;
-
-                if (Math.abs(currentValue - newValue) > 0.01) {
-                    slider.value = newValue
+                var range = Math.abs(currentGroup.from - currentGroup.to);
+                if (Math.abs(currentValue - newValue) > range * 0.01) { // Only move if greater than a 1% change
+                    slider.value = newValue;
                 }
             }
         });