Skip to content

Commit 6bc077d

Browse files
authored
Merge pull request phaserjs#5269 from halilcakar/master
Fix for phaserjs#5019
2 parents f61040d + 7593a80 commit 6bc077d

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/actions/GridAlign.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,26 @@ var GridAlign = function (items, options)
6565
// We keep laying them out vertically until we've done them all
6666
tempZone.y += cellHeight;
6767
}
68+
else if (heightSet && !widthSet)
69+
{
70+
// We keep laying them out until we hit the column limit
71+
cy += cellHeight;
72+
tempZone.y += cellHeight;
73+
74+
if (cy === h)
75+
{
76+
cy = 0;
77+
cx += cellWidth;
78+
tempZone.y = y;
79+
tempZone.x += cellWidth;
80+
81+
if (cx === w)
82+
{
83+
// We've hit the column limit, so return, even if there are items left
84+
break;
85+
}
86+
}
87+
}
6888
else
6989
{
7090
// We keep laying them out until we hit the column limit

0 commit comments

Comments
 (0)