diff options
author | Eugene Sandulenko | 2016-04-12 19:24:59 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-04-12 19:24:59 +0200 |
commit | 5741915aa0ef202bf79275cb2386f261689d5d84 (patch) | |
tree | 47283907edda344bc50fcc76c4dde25dd2d4de9b /engines | |
parent | f5979abaa28eece472400ef83a7acc2bdfc74de9 (diff) | |
download | scummvm-rg350-5741915aa0ef202bf79275cb2386f261689d5d84.tar.gz scummvm-rg350-5741915aa0ef202bf79275cb2386f261689d5d84.tar.bz2 scummvm-rg350-5741915aa0ef202bf79275cb2386f261689d5d84.zip |
WAGE: Fix click target search order
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/gui.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 93c799e73a..bd74855a3e 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -588,12 +588,14 @@ Designed *Gui::mouseUp(int x, int y) { _bordersDirty = true; } - for (ObjList::const_iterator it = _scene->_objs.begin(); it != _scene->_objs.end(); ++it) { + for (ObjList::const_iterator it = _scene->_objs.end(); it != _scene->_objs.begin(); ) { + it--; if ((*it)->_design->isPointOpaque(x - _sceneArea.left + kBorderWidth, y - _sceneArea.top + kBorderWidth)) return *it; } - for (ChrList::const_iterator it = _scene->_chrs.begin(); it != _scene->_chrs.end(); ++it) { + for (ChrList::const_iterator it = _scene->_chrs.end(); it != _scene->_chrs.begin(); ) { + it--; if ((*it)->_design->isPointOpaque(x - _sceneArea.left + kBorderWidth, y - _sceneArea.top + kBorderWidth)) return *it; } |