From 9b98b766b2b8b0400a19918f72be6bc4ebc4e9ed Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Tue, 29 Aug 2017 20:58:23 +0200 Subject: [PATCH] Fix off by one error for action area (#663) If the mouse was at the leftmost edge of the screen and there was an action area from 0 to N, the click wouldn't register Before if an action area was defined from A to B it was from A exclusive to B inclusive now it is from A inclusive to B exclusive. This is the same way that the pixel addresses work, since a pixel's coordinate is defined by the top-left corner. Fixes #661 --- include/components/types.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/components/types.hpp b/include/components/types.hpp index 82450c9a..17fa89c2 100644 --- a/include/components/types.hpp +++ b/include/components/types.hpp @@ -113,7 +113,7 @@ struct action_block : public action { } bool test(int point) const { - return static_cast(start_x) < point && static_cast(end_x) >= point; + return static_cast(start_x) <= point && static_cast(end_x) > point; } };