Skip to content

Commit 60c34d3

Browse files
PopupMenu: Adjust the bounds of a menu that intersects with safe inset areas
1 parent 88af872 commit 60c34d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/juce_gui_basics/menus/juce_PopupMenu.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,13 @@ struct MenuWindow final : public Component
373373
}
374374
else
375375
{
376-
const auto shouldDisableAccessibility = [this]
376+
const auto shouldDisableAccessibility = std::invoke ([this]
377377
{
378378
const auto* compToCheck = parent != nullptr ? parent
379379
: options.getTargetComponent();
380380

381381
return compToCheck != nullptr && ! compToCheck->isAccessible();
382-
}();
382+
});
383383

384384
if (shouldDisableAccessibility)
385385
setAccessible (false);
@@ -874,7 +874,7 @@ struct MenuWindow final : public Component
874874
auto parentArea = getParentArea (target.getCentre()) / scaleFactor;
875875

876876
if (auto* pc = options.getParentComponent())
877-
target = pc->getLocalArea (nullptr, target).getIntersection (parentArea);
877+
target = pc->getLocalArea (nullptr, target).constrainedWithin (parentArea);
878878

879879
auto maxMenuHeight = parentArea.getHeight() - 24;
880880

0 commit comments

Comments
 (0)