gui: fix IsInRegion
(0,0) was inside the region of "locationless" action objects,
leading to all kinds of strange behavior when clicking in the
upper left corner.
Change-Id: I222db4ff499f3c30605b05267f005accb2e0dc99
diff --git a/gui/console.cpp b/gui/console.cpp
index aad392c..218a305 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -339,7 +339,7 @@
}
// IsInRegion - Checks if the request is handled by this object
-// Return 0 if this object handles the request, 1 if not
+// Return 1 if this object handles the request, 0 if not
int GUIConsole::IsInRegion(int x, int y)
{
if (mSlideout)
@@ -353,7 +353,7 @@
return 0;
}
- return (x < mConsoleX || x > mConsoleX + mConsoleW || y < mConsoleY || y > mConsoleY + mConsoleH) ? 0 : 1;
+ return (x < mConsoleX || x >= mConsoleX + mConsoleW || y < mConsoleY || y >= mConsoleY + mConsoleH) ? 0 : 1;
}
// NotifyTouch - Notify of a touch event