Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 7d3a28e

Browse files
committed
[[ Bug 19536 ]] Fix menu not closing when clicking on other side
This patch fixes a bugh where the stack of the button with the menu was being used to determine if the user clicked away from the menu rather than the menu stack itself. This was causing the menu to only dismiss if the use clicked in a location less than the top left of the button.
1 parent 0cc53c2 commit 7d3a28e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/notes/bugfix-19536.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix menu not being dismissed when user clicks on location greater than menu right or bottom

engine/src/button.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ Boolean MCButton::mup(uint2 which, bool p_release)
13731373
// We also need to close the menu if the button release happened
13741374
// outside of the menu tree.
13751375
bool t_outside = true;
1376-
MCObject* t_menu = this;
1376+
MCObject* t_menu = menu;
13771377
while (t_outside && t_menu != NULL)
13781378
{
13791379
// Check whether the click was inside the menu (the rect

0 commit comments

Comments
 (0)