Prechádzať zdrojové kódy

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

Sebastien Vandenberghe 7 rokov pred
rodič
commit
57928b203d
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      sandbox/index.js

+ 3 - 3
sandbox/index.js

@@ -116,9 +116,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;
                 }
             }
         });