Fix HorizontalPanel and VerticalPanel auto-sizing if child control is using anchors
Fixes #203
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user