panelcomponent: fix removing final gap from total width/height

This commit is contained in:
Adam
2020-03-14 13:21:51 -04:00
parent dd18626d15
commit 43998972cf

View File

@@ -163,8 +163,14 @@ public class PanelComponent implements LayoutableRenderableEntity
}
// Remove last child gap
totalWidth -= gap.x;
totalHeight -= gap.y;
if (orientation == ComponentOrientation.HORIZONTAL)
{
totalWidth -= gap.x;
}
else // VERTICAL
{
totalHeight -= gap.y;
}
// Cache children bounds
childDimensions.setSize(totalWidth, totalHeight);