Skip to content

Commit

Permalink
Take in to account padding for width calc
Browse files Browse the repository at this point in the history
  • Loading branch information
firthm01 committed Jan 21, 2024
1 parent d1cb9c4 commit e3c784f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shared/components/ear_combo_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit e3c784f

Please sign in to comment.