From e3c784f09d20dd49bd5402c7cb614025f60790bf Mon Sep 17 00:00:00 2001 From: Matt Firth Date: Sun, 21 Jan 2024 02:50:00 +0000 Subject: [PATCH] Take in to account padding for width calc --- shared/components/ear_combo_box.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared/components/ear_combo_box.cpp b/shared/components/ear_combo_box.cpp index 3b66c8d60..b15618971 100644 --- a/shared/components/ear_combo_box.cpp +++ b/shared/components/ear_combo_box.cpp @@ -120,6 +120,10 @@ StringArray EarComboBoxTextWithSubtextEntry::getSubtext() const { return origina void EarComboBoxTextWithSubtextEntry::resizeForWidth(int width) { + // Subtract expected line padding to get true available width + width -= padLeftListEntrySubtext_; + width -= padRightListEntrySubtext_; + // Calc req height auto h = heightListEntryText_; if (width != structuredSubtextWidth_) { // generate structuredSubtext_ from originalSubtext_ to fit `width`