fix animate steps==0 bug
This commit is contained in:
parent
7bad06ab75
commit
6588a0bd1b
@ -2134,6 +2134,7 @@ control.prototype.setCurtain = function(color, time, callback) {
|
||||
control.prototype._setCurtain_animate = function (nowColor, color, time, callback) {
|
||||
time /= Math.max(core.status.replay.speed, 1)
|
||||
var per_time = 10, step = parseInt(time / per_time);
|
||||
if (step <= 0) step = 1;
|
||||
var animate = setInterval(function() {
|
||||
nowColor = [
|
||||
(nowColor[0]*(step-1)+color[0])/step,
|
||||
|
||||
@ -2157,6 +2157,7 @@ events.prototype.moveImage = function (code, to, opacityVal, time, callback) {
|
||||
|
||||
events.prototype._moveImage_moving = function (name, moveInfo, callback) {
|
||||
var per_time = 10, step = 0, steps = parseInt(moveInfo.time / 10);
|
||||
if (steps <= 0) steps = 1;
|
||||
var fromX = moveInfo.fromX, fromY = moveInfo.fromY, toX = moveInfo.toX, toY = moveInfo.toY,
|
||||
opacity = moveInfo.opacity, toOpacity = moveInfo.toOpacity;
|
||||
var currX = fromX, currY = fromY, currOpacity = opacity;
|
||||
@ -2211,6 +2212,7 @@ events.prototype.setVolume = function (value, time, callback) {
|
||||
var currVolume = core.musicStatus.volume;
|
||||
time /= Math.max(core.status.replay.speed, 1);
|
||||
var per_time = 10, step = 0, steps = parseInt(time / per_time);
|
||||
if (steps <= 0) steps = 1;
|
||||
var fade = setInterval(function () {
|
||||
step++;
|
||||
set(currVolume + (value - currVolume) * step / steps);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user