From bcd7ae1fb5787d9b4d011f2bd4a092242e92c9c3 Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 24 May 2021 18:36:56 +0100 Subject: [PATCH] PopupMenu: Avoid cropping menu items at the bottom of long menus with large borders --- modules/juce_gui_basics/menus/juce_PopupMenu.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp index 67b77c8061..dcbe7fac7b 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.cpp +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.cpp @@ -882,12 +882,11 @@ struct MenuWindow : public Component insertColumnBreaks (maxMenuW, maxMenuH); workOutManualSize (maxMenuW); - auto actualH = jmin (contentHeight, maxMenuH); + height = jmin (contentHeight, maxMenuH); - needsToScroll = contentHeight > actualH; + needsToScroll = contentHeight > height; width = updateYPositions(); - height = actualH + getLookAndFeel().getPopupMenuBorderSizeWithOptions (options) * 2; } void insertColumnBreaks (const int maxMenuW, const int maxMenuH) @@ -972,6 +971,8 @@ struct MenuWindow : public Component it = columnEnd; } + contentHeight += getLookAndFeel().getPopupMenuBorderSizeWithOptions (options) * 2; + correctColumnWidths (maxMenuW); }