mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 02:28:44 +08:00
[ts] Fixed slider updates so we don't burn up CPUs
This commit is contained in:
parent
e05eaef52f
commit
b112ef10d3
@ -110,7 +110,11 @@ var animationMixingDemo = function(loadingComplete, bgColor) {
|
||||
function render () {
|
||||
timeKeeper.update();
|
||||
var delta = timeKeeper.delta * timeSlider.get();
|
||||
if (timeSliderLabel) timeSliderLabel.text(Math.round(timeSlider.get() * 100) + "%");
|
||||
if (timeSliderLabel) {
|
||||
var oldValue = timeSliderLabel[0].textContent;
|
||||
var newValue = Math.round(timeSlider.get() * 100) + "%";
|
||||
if (oldValue !== newValue) timeSliderLabel[0].textContent = newValue;
|
||||
}
|
||||
|
||||
var offset = bounds.offset;
|
||||
var size = bounds.size;
|
||||
|
||||
@ -114,7 +114,11 @@ var spritesheetDemo = function(loadingComplete, bgColor) {
|
||||
var delta = timeKeeper.delta;
|
||||
|
||||
delta *= timeSlider.get();
|
||||
if (timeSliderLabel) timeSliderLabel.text(Math.round(timeSlider.get() * 100) + "%");
|
||||
if (timeSliderLabel) {
|
||||
var oldValue = timeSliderLabel[0].textContent;
|
||||
var newValue = Math.round(timeSlider.get() * 100) + "%";
|
||||
if (oldValue !== newValue) timeSliderLabel[0].textContent = newValue;
|
||||
}
|
||||
|
||||
var animationDuration = animationState.getCurrent(0).animation.duration;
|
||||
playTime += delta;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user