Revert children clipping to be called outside DrawChildren (regression from #355)

This commit is contained in:
Wojtek Figat
2021-03-18 14:26:00 +01:00
parent 922201d1c0
commit 960a122550

View File

@@ -622,7 +622,18 @@ namespace FlaxEngine.GUI
public override void Draw()
{
DrawSelf();
DrawChildren();
if (ClipChildren)
{
GetDesireClientArea(out var clientArea);
Render2D.PushClip(ref clientArea);
DrawChildren();
Render2D.PopClip();
}
else
{
DrawChildren();
}
}
/// <summary>
@@ -638,13 +649,6 @@ namespace FlaxEngine.GUI
/// </summary>
protected virtual void DrawChildren()
{
// Push clipping mask
if (ClipChildren)
{
GetDesireClientArea(out var clientArea);
Render2D.PushClip(ref clientArea);
}
// Draw all visible child controls
if (CullChildren)
{
@@ -679,12 +683,6 @@ namespace FlaxEngine.GUI
}
}
}
// Pop clipping mask
if (ClipChildren)
{
Render2D.PopClip();
}
}
/// <inheritdoc />