diff --git a/libs/control.js b/libs/control.js index 32c17f4c..d87455ae 100644 --- a/libs/control.js +++ b/libs/control.js @@ -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, diff --git a/libs/events.js b/libs/events.js index 9e3b2888..16d626b5 100644 --- a/libs/events.js +++ b/libs/events.js @@ -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);