Browse Source

PopupMenu: Use correct alignment for submenus with large borders

v6.1.6
reuk 4 years ago
parent
commit
0a4a67d439
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      modules/juce_gui_basics/menus/juce_PopupMenu.cpp

+ 3
- 2
modules/juce_gui_basics/menus/juce_PopupMenu.cpp View File

@@ -854,8 +854,9 @@ struct MenuWindow : public Component
if (getLookAndFeel().getPopupMenuBorderSizeWithOptions (options) == 0) // workaround for dismissing the window on mouse up when border size is 0
x += tendTowardsRight ? 1 : -1;
y = target.getCentreY() > parentArea.getCentreY() ? jmax (parentArea.getY(), target.getBottom() - heightToUse)
: target.getY();
const auto border = getLookAndFeel().getPopupMenuBorderSizeWithOptions (options);
y = target.getCentreY() > parentArea.getCentreY() ? jmax (parentArea.getY(), target.getBottom() - heightToUse) + border
: target.getY() - border;
}
x = jmax (parentArea.getX() + 1, jmin (parentArea.getRight() - (widthToUse + 6), x));


Loading…
Cancel
Save