Skip to content

Commit da2b91b

Browse files
committed
ArrayUtils.AddAt didn't calculate the array offset correctly if you passed an array in to be merged with an existing array. This also caused Container.addAt to fail if an array was passed to it. Fix phaserjs#3788
1 parent 6cc7939 commit da2b91b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
* `GameObject.disableInteractive` was toggling input. Every second call would turn the input back on (thanks @TadejZupancic)
5959
* The position of the TilemapLayer wasn't taken into account when culling tiles for the Camera. It's now calculated as part of the cull flow (thanks @Upperfoot)
6060
* Fix extra argument passing in Array.Each (thanks @samme)
61-
* TileSprite was using the Size compontent instead of ComputedSize, meaning its `getBounds` and `displayWidth` and `displayHeight` results were incorrect. Fix #3789 (thanks @jjalonso)
61+
* TileSprite was using the Size compontent instead of ComputedSize, meaning its `getBounds` and `displayWidth` and `displayHeight` results were incorrect. Fix #3789 (thanks @jjalonso)
62+
* ArrayUtils.AddAt didn't calculate the array offset correctly if you passed an array in to be merged with an existing array. This also caused Container.addAt to fail if an array was passed to it. Fix #3788 (thanks @jjalonso)
6263

6364
### Examples, Documentation and TypeScript
6465

src/utils/array/AddAt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ var AddAt = function (array, item, index, limit, callback, context)
9898
itemLength = remaining;
9999
}
100100

101-
for (var i = itemLength; i > 0; i--)
101+
for (var i = itemLength - 1; i >= 0; i--)
102102
{
103103
var entry = item[i];
104104

0 commit comments

Comments
 (0)