toggling no-animation sets max speed
This commit is contained in:
parent
7b201c421d
commit
40dbbd2e60
1 changed files with 5 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ self.kiri.loader.push(function() {
|
||||||
progress, toolPosX, toolPosY, toolPosZ,
|
progress, toolPosX, toolPosY, toolPosZ,
|
||||||
speedValues = [ 25, 12, 6, 3 ],
|
speedValues = [ 25, 12, 6, 3 ],
|
||||||
speedNames = [ "1x", "2x", "4x", "8x" ],
|
speedNames = [ "1x", "2x", "4x", "8x" ],
|
||||||
|
speedMax = speedValues.length - 1,
|
||||||
speedIndex = 0,
|
speedIndex = 0,
|
||||||
speedLabel,
|
speedLabel,
|
||||||
speed,
|
speed,
|
||||||
|
|
@ -70,7 +71,9 @@ self.kiri.loader.push(function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
function updateSpeed(inc = 0) {
|
function updateSpeed(inc = 0) {
|
||||||
if (inc > 0) {
|
if (inc === Infinity) {
|
||||||
|
speedIndex = speedMax;
|
||||||
|
} else if (inc > 0) {
|
||||||
speedIndex = (speedIndex + inc) % speedValues.length;
|
speedIndex = (speedIndex + inc) % speedValues.length;
|
||||||
}
|
}
|
||||||
speed = speedValues[speedIndex];
|
speed = speedValues[speedIndex];
|
||||||
|
|
@ -183,6 +186,7 @@ self.kiri.loader.push(function() {
|
||||||
API.show.alert('fast fowarding without animation');
|
API.show.alert('fast fowarding without animation');
|
||||||
playButton.style.display = 'none';
|
playButton.style.display = 'none';
|
||||||
pauseButton.style.display = '';
|
pauseButton.style.display = '';
|
||||||
|
updateSpeed(Infinity);
|
||||||
KIRI.client.animate({speed, steps: Infinity, toend: true}, handleGridUpdate);
|
KIRI.client.animate({speed, steps: Infinity, toend: true}, handleGridUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue