From b5c88535a3262c4a665321951188af5250322275 Mon Sep 17 00:00:00 2001 From: katto Date: Mon, 17 Mar 2025 11:09:32 +0700 Subject: [PATCH] prevent combobox paint on invalid size --- AcrylicUI/Controls/AcrylicComboBox.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AcrylicUI/Controls/AcrylicComboBox.cs b/AcrylicUI/Controls/AcrylicComboBox.cs index a4efdde..3e907f7 100644 --- a/AcrylicUI/Controls/AcrylicComboBox.cs +++ b/AcrylicUI/Controls/AcrylicComboBox.cs @@ -138,6 +138,9 @@ protected override void OnResize(EventArgs e) private void PaintCombobox() { + if (ClientRectangle.Width <= 0 || ClientRectangle.Height <= 0) + return; + if (_buffer == null) _buffer = new Bitmap(ClientRectangle.Width, ClientRectangle.Height);