diff --git a/Source/Engine/UI/GUI/ContainerControl.cs b/Source/Engine/UI/GUI/ContainerControl.cs
index 817bc28a5..8e046ecde 100644
--- a/Source/Engine/UI/GUI/ContainerControl.cs
+++ b/Source/Engine/UI/GUI/ContainerControl.cs
@@ -616,32 +616,35 @@ namespace FlaxEngine.GUI
}
}
- ///
+ ///
+ /// Draw the control and the children.
+ ///
public override void Draw()
{
- base.Draw();
+ DrawSelf();
+ DrawChildren();
+ }
+ ///
+ /// Draws the control.
+ ///
+ public virtual void DrawSelf()
+ {
+ base.Draw();
+ }
+
+ ///
+ /// Draws the children. Can be overridden to provide some customizations. Draw is performed with applied clipping mask for the client area.
+ ///
+ protected virtual void DrawChildren()
+ {
// Push clipping mask
if (ClipChildren)
{
GetDesireClientArea(out var clientArea);
Render2D.PushClip(ref clientArea);
}
-
- DrawChildren();
-
- // Pop clipping mask
- if (ClipChildren)
- {
- Render2D.PopClip();
- }
- }
-
- ///
- /// Draws the children. Can be overridden to provide some customizations. Draw is performed with applied clipping mask for the client area.
- ///
- protected virtual void DrawChildren()
- {
+
// Draw all visible child controls
if (CullChildren)
{
@@ -676,6 +679,12 @@ namespace FlaxEngine.GUI
}
}
}
+
+ // Pop clipping mask
+ if (ClipChildren)
+ {
+ Render2D.PopClip();
+ }
}
///