mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Allow tapping submenu item to hide submenu
This commit is contained in:
@@ -147,9 +147,10 @@ public abstract class FDropDown extends FScrollPane {
|
|||||||
public boolean tap(float x, float y, int count) {
|
public boolean tap(float x, float y, int count) {
|
||||||
hide(); //always hide if tapped
|
hide(); //always hide if tapped
|
||||||
|
|
||||||
//prevent owner handling this tap unless it's a sub menu
|
//prevent owner handling this tap unless it's a sub menu and not over it
|
||||||
if (getDropDownOwner() instanceof FSubMenu) {
|
FDisplayObject owner = getDropDownOwner();
|
||||||
return false;
|
if (owner instanceof FSubMenu) {
|
||||||
|
return owner.contains(owner.getLeft() + owner.screenToLocalX(x), owner.getTop() + owner.screenToLocalY(y));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user