fix layout grid bug for fireball/issues/8166 (#3093)

This commit is contained in:
Knox
2018-08-15 13:51:43 +08:00
committed by pandamicro
parent d25d3d8fc1
commit e92c36593e
+2 -2
View File
@@ -587,13 +587,13 @@ var Layout = cc.Class({
secondMaxHeight = childBoundingBoxHeight;
tempMaxHeight = 0;
}
nextX = leftBoundaryOfLayout + sign * (paddingX + anchorX * child.width);
nextX = leftBoundaryOfLayout + sign * (paddingX + anchorX * childBoundingBoxWidth);
row++;
}
}
var finalPositionY = fnPositionY(child, rowMaxHeight, row);
if (baseWidth >= (child.width + this.paddingLeft + this.paddingRight)) {
if (baseWidth >= (childBoundingBoxWidth + this.paddingLeft + this.paddingRight)) {
if (applyChildren) {
child.setPosition(cc.v2(nextX, finalPositionY));
}