Skip to content

Commit 8bc5ba8

Browse files
committed
Tween.generateData would skip the end values in the data array. They are now included as the object in the final array element.
1 parent 865c687 commit 8bc5ba8

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ Version 2.1.0 - "Cairhien" - -in development-
171171
* ScaleManager window.resize handler would constantly dispatch enterPortrait and enterLandscape events on window resizing, regardless if it actually entered that orientation or not.
172172
* Added Sound._muteVolume which stops Firefox and IE9 crashing if you try to unmute a sound that hasn't yet been muted, which can also happen as a result of a game visibility change (thanks @osmanzeki #1108 #1123)
173173
* P2.World.getSprings used to return an empty array, but now returns all the Springs in the world (#1134)
174+
* Tween.generateData would skip the end values in the data array. They are now included as the object in the final array element.
174175

175176
### p2.js 0.6.0 Changes and New Features
176177

src/tween/Tween.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,16 +409,15 @@ Phaser.Tween.prototype = {
409409
}
410410
else
411411
{
412-
// Parses relative end values with start as base (e.g.: +10, -3)
413-
if (typeof(end) === 'string')
412+
if (typeof end === 'string')
414413
{
414+
// Parses relative end values with start as base (e.g.: +10, -3)
415415
end = start + parseFloat(end, 10);
416416
}
417-
418-
// protect against non numeric properties.
419-
if (typeof(end) === 'number')
417+
else if (typeof end === 'number')
420418
{
421-
blob[property] = start + ( end - start ) * value;
419+
// Protect against non numeric properties.
420+
blob[property] = start + (end - start) * value;
422421
}
423422
}
424423
}
@@ -428,6 +427,15 @@ Phaser.Tween.prototype = {
428427
time += tick;
429428
}
430429

430+
var blob = {};
431+
432+
for (property in this._valuesEnd)
433+
{
434+
blob[property] = this._valuesEnd[property];
435+
}
436+
437+
output.push(blob);
438+
431439
if (this._yoyo)
432440
{
433441
var reversed = output.slice();

0 commit comments

Comments
 (0)