Allow tapping submenu item to hide submenu

This commit is contained in:
drdev
2014-04-12 06:07:13 +00:00
parent 51b7c8bf6d
commit 64418f4e41

View File

@@ -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;
} }