Skip to content

Commit 76e1c57

Browse files
committed
Merge pull request phaserjs#1710 from hardalias/bugfix/tween_dividebyzero
Fixes neverending tween when duration set to zero (caused by division with zero)
2 parents 645723f + 4bd7a40 commit 76e1c57

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/tween/Tween.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Phaser.Tween.prototype = {
183183
*/
184184
to: function (properties, duration, ease, autoStart, delay, repeat, yoyo) {
185185

186-
if (typeof duration === 'undefined') { duration = 1000; }
186+
if (typeof duration === 'undefined' || duration <= 0) { duration = 1000; }
187187
if (typeof ease === 'undefined') { ease = Phaser.Easing.Default; }
188188
if (typeof autoStart === 'undefined') { autoStart = false; }
189189
if (typeof delay === 'undefined') { delay = 0; }

0 commit comments

Comments
 (0)