From 8a15073c43376f40948fb3714bc73c5a033f5188 Mon Sep 17 00:00:00 2001 From: Ben Olden-Cooligan Date: Sat, 31 Aug 2024 22:04:46 -0700 Subject: [PATCH] Fix issue with dropdown height measurement --- NAPS2.Lib.WinForms/EtoForms/WinForms/WinFormsEtoPlatform.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NAPS2.Lib.WinForms/EtoForms/WinForms/WinFormsEtoPlatform.cs b/NAPS2.Lib.WinForms/EtoForms/WinForms/WinFormsEtoPlatform.cs index b34001d50f..6146370f42 100644 --- a/NAPS2.Lib.WinForms/EtoForms/WinForms/WinFormsEtoPlatform.cs +++ b/NAPS2.Lib.WinForms/EtoForms/WinForms/WinFormsEtoPlatform.cs @@ -194,7 +194,7 @@ public override SizeF GetPreferredSize(Control control, SizeF availableSpace) var preferredSize = SizeF.Max( base.GetPreferredSize(control, availableSpace), native.PreferredSize.ToEto()); - if (control.GetType() == typeof(DropDown)) + if (control.GetType() == typeof(DropDown) && control.Height > 0) { // Work around a WinForms bug where the preferred height of a DropDown is incorrect preferredSize.Height = control.Height;