diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index 32ace95..16d6c7a 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -213,6 +213,8 @@ namespace MLEM.Ui.Elements { // update the render target var targetArea = (Rectangle) this.GetRenderTargetArea(); + if (targetArea.Width <= 0 || targetArea.Height <= 0) + return; if (this.renderTarget == null || targetArea.Width != this.renderTarget.Width || targetArea.Height != this.renderTarget.Height) { if (this.renderTarget != null) this.renderTarget.Dispose();