1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-05 03:50:07 +00:00

Fixed an issue where the scale of a PopupMenu would be incorrect when no targetComponent was specifiefd

This commit is contained in:
hogliux 2017-07-03 16:38:03 +01:00
parent 2540725b6a
commit b574d4530e

View file

@ -217,7 +217,8 @@ public:
parentComponent = lf.getParentComponentForMenuOptions (options);
if (parentComponent == nullptr && parentWindow == nullptr && lf.shouldPopupMenuScaleWithTargetComponent (options))
scaleFactor = getApproximateScaleFactorForTargetComponent (options.getTargetComponent());
if (auto* targetComponent = options.getTargetComponent())
scaleFactor = getApproximateScaleFactorForTargetComponent (targetComponent);
setOpaque (lf.findColour (PopupMenu::backgroundColourId).isOpaque()
|| ! Desktop::canUseSemiTransparentWindows());