Fix HorizontalPanel and VerticalPanel auto-sizing if child control is using anchors

Fixes #203
This commit is contained in:
Wojtek Figat
2021-02-07 16:49:44 +01:00
parent 08abc798cc
commit ca6afc0c2d
2 changed files with 2 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ namespace FlaxEngine.GUI
for (int i = 0; i < _children.Count; i++)
{
Control c = _children[i];
if (c.Visible)
if (c.Visible && Mathf.IsZero(c.AnchorMax.X))
{
var w = c.Width;
c.Bounds = new Rectangle(x + _offset.X, _margin.Top + _offset.Y, w, h);

View File

@@ -42,7 +42,7 @@ namespace FlaxEngine.GUI
for (int i = 0; i < _children.Count; i++)
{
Control c = _children[i];
if (c.Visible)
if (c.Visible && Mathf.IsZero(c.AnchorMax.Y))
{
var h = c.Height;
c.Bounds = new Rectangle(_margin.Left + _offset.X, y + _offset.Y, w, h);