aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorTorbjörn Andersson2019-01-04 14:47:36 +0100
committerTorbjörn Andersson2019-01-04 14:47:36 +0100
commit7394afbbc80be994cea0a83a91fadaf9aeccffdd (patch)
tree3d30442b6503d6fdd6d8be7e390019954ae3f9a2 /engines/glk
parentf023f28127c00ac510b281581eebd66582a8873e (diff)
downloadscummvm-rg350-7394afbbc80be994cea0a83a91fadaf9aeccffdd.tar.gz
scummvm-rg350-7394afbbc80be994cea0a83a91fadaf9aeccffdd.tar.bz2
scummvm-rg350-7394afbbc80be994cea0a83a91fadaf9aeccffdd.zip
GLK: Fix negative index crash when clicking in a window
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/window_pair.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/glk/window_pair.cpp b/engines/glk/window_pair.cpp
index 7ddd57b23c..d571dc58e7 100644
--- a/engines/glk/window_pair.cpp
+++ b/engines/glk/window_pair.cpp
@@ -245,7 +245,7 @@ void PairWindow::setArrangement(uint method, uint size, Window *keyWin) {
}
void PairWindow::click(const Point &newPos) {
- for (int ctr = 0, idx = (!_backward ? (int)_children.size() - 1 : 0); ctr < (int)_children.size();
+ for (int ctr = 0, idx = (_backward ? (int)_children.size() - 1 : 0); ctr < (int)_children.size();
++ctr, idx += (_backward ? -1 : 1)) {
Window *w = _children[idx];
if (w->_bbox.contains(newPos))