Revert children clipping to be called outside DrawChildren (regression from #355)
This commit is contained in:
@@ -622,7 +622,18 @@ namespace FlaxEngine.GUI
|
|||||||
public override void Draw()
|
public override void Draw()
|
||||||
{
|
{
|
||||||
DrawSelf();
|
DrawSelf();
|
||||||
DrawChildren();
|
|
||||||
|
if (ClipChildren)
|
||||||
|
{
|
||||||
|
GetDesireClientArea(out var clientArea);
|
||||||
|
Render2D.PushClip(ref clientArea);
|
||||||
|
DrawChildren();
|
||||||
|
Render2D.PopClip();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DrawChildren();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -630,21 +641,14 @@ namespace FlaxEngine.GUI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void DrawSelf()
|
public virtual void DrawSelf()
|
||||||
{
|
{
|
||||||
base.Draw();
|
base.Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draws the children. Can be overridden to provide some customizations. Draw is performed with applied clipping mask for the client area.
|
/// Draws the children. Can be overridden to provide some customizations. Draw is performed with applied clipping mask for the client area.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void DrawChildren()
|
protected virtual void DrawChildren()
|
||||||
{
|
{
|
||||||
// Push clipping mask
|
|
||||||
if (ClipChildren)
|
|
||||||
{
|
|
||||||
GetDesireClientArea(out var clientArea);
|
|
||||||
Render2D.PushClip(ref clientArea);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw all visible child controls
|
// Draw all visible child controls
|
||||||
if (CullChildren)
|
if (CullChildren)
|
||||||
{
|
{
|
||||||
@@ -679,12 +683,6 @@ namespace FlaxEngine.GUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pop clipping mask
|
|
||||||
if (ClipChildren)
|
|
||||||
{
|
|
||||||
Render2D.PopClip();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
Reference in New Issue
Block a user