Browse Source

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

tags/2021-05-28
hogliux 8 years ago
parent
commit
b574d4530e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      modules/juce_gui_basics/menus/juce_PopupMenu.cpp

+ 2
- 1
modules/juce_gui_basics/menus/juce_PopupMenu.cpp 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());


Loading…
Cancel
Save