diff options
-rw-r--r-- | engines/parallaction/zone.cpp | 12 | ||||
-rw-r--r-- | engines/parallaction/zone.h | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp index 738e30c968..dbc4d1dab1 100644 --- a/engines/parallaction/zone.cpp +++ b/engines/parallaction/zone.cpp @@ -581,10 +581,14 @@ Zone *hitZone(uint32 type, uint16 x, uint16 y) { if (z->_flags & kFlagsRemove) continue; - if ((_si >= z->_right) || - (_si <= z->_left) || - (_di >= z->_bottom) || - (_di <= z->_top)) { + Common::Rect r; + z->getRect(r); + r.right++; // adjust border because Common::Rect doesn't include bottom-right edge + r.bottom++; + + r.grow(-1); // allows some tolerance for mouse click + + if (!r.contains(_si, _di)) { // out of Zone, so look for special values if ((z->_left == -2) || (z->_left == -3)) { diff --git a/engines/parallaction/zone.h b/engines/parallaction/zone.h index 12af43e231..3c6b9162aa 100644 --- a/engines/parallaction/zone.h +++ b/engines/parallaction/zone.h @@ -141,6 +141,13 @@ struct Zone : public Node { Command *_commands; Point _moveTo; + void getRect(Common::Rect& r) const { + r.left = _left; + r.right = _right; + r.top = _top; + r.bottom = _bottom; + } + void translate(int16 x, int16 y) { _left += x; _right += x; |