1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-19 01:04:20 +00:00

PopupMenu: Use correct alignment for submenus with large borders

This commit is contained in:
reuk 2021-05-24 19:40:47 +01:00
parent bcd7ae1fb5
commit 0a4a67d439

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));