Skip to content

Commit 0b2bea3

Browse files
committed
Removed hasOwnProperty check from Tween.from because it breaks on extended or inherited Game Objects.
1 parent 2a10647 commit 0b2bea3

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ Calling addToWorld() would previously not check the _toRemove array, which could
169169
* When adding a new Animation to a Sprite it would incorrectly reset the current Sprite frame to the first frame of the animation sequence, it is now left un-touched until you call `play` on the animation.
170170
* Tween.from now returns a reference to the tweened object in the same way that Tween.to does (thanks @b-ely, fix #976)
171171
* Re-ordered the parameters of Phaser.Physics.Arcade.Body.render which is used by Debug.body so it matches correctly (thanks @psalaets, #971 #970)
172+
* Removed hasOwnProperty check from Tween.from because it breaks on extended or inherited Game Objects.
172173

173174

174175

src/tween/Tween.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,8 @@ Phaser.Tween.prototype = {
280280

281281
for (var prop in properties)
282282
{
283-
if (properties.hasOwnProperty(prop))
284-
{
285-
_cache[prop] = this._object[prop];
286-
this._object[prop] = properties[prop];
287-
}
283+
_cache[prop] = this._object[prop];
284+
this._object[prop] = properties[prop];
288285
}
289286

290287
return this.to(_cache, duration, ease, autoStart, delay, repeat, yoyo);

0 commit comments

Comments
 (0)