aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-15 21:04:37 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commitbd4bc0a43f5f90c6c4cead91df9f5296f3b82899 (patch)
tree0344f28645e45c33d8d037d956c887c7a377db98
parent238022890edd256182d0bebd894af39a7f6cd79b (diff)
downloadscummvm-rg350-bd4bc0a43f5f90c6c4cead91df9f5296f3b82899.tar.gz
scummvm-rg350-bd4bc0a43f5f90c6c4cead91df9f5296f3b82899.tar.bz2
scummvm-rg350-bd4bc0a43f5f90c6c4cead91df9f5296f3b82899.zip
GLK: FROTZ: Fix crash clicking screen with mouse without dragging
-rw-r--r--engines/glk/selection.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/glk/selection.cpp b/engines/glk/selection.cpp
index 2bc4fb81cb..566ae65345 100644
--- a/engines/glk/selection.cpp
+++ b/engines/glk/selection.cpp
@@ -152,10 +152,8 @@ void Selection::startSelection(const Point &pos) {
tx = MIN(pos.x, (int16)_hor);
ty = MIN(pos.y, (int16)_ver);
- _select.left = _last.x = tx;
- _select.top = _last.y = ty;
- _select.right = 0;
- _select.bottom = 0;
+ _select.left = _select.right = _last.x = tx;
+ _select.top = _select.bottom = _last.y = ty;
g_vm->_windows->selectionChanged();
}
@@ -189,8 +187,8 @@ void Selection::clearSelection() {
}
bool Selection::checkSelection(const Rect &r) const {
- Rect select(MIN(_select.left, _select.right), MAX(_select.left, _select.right),
- MIN(_select.top, _select.bottom), MAX(_select.top, _select.bottom));
+ Rect select(MIN(_select.left, _select.right), MIN(_select.top, _select.bottom),
+ MAX(_select.left, _select.right), MAX(_select.top, _select.bottom));
if (select.isEmpty())
return false;