aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kohaut2019-05-30 23:25:11 +0200
committerPeter Kohaut2019-05-30 23:27:34 +0200
commita3eeebb4d40e176e7f8302c89f2d4065228c79d9 (patch)
tree4d8f93e3f3211694e48be774f23608a294636c4a
parent4631ec94a1f908924f4807b43ccc818a467f7dba (diff)
downloadscummvm-rg350-a3eeebb4d40e176e7f8302c89f2d4065228c79d9.tar.gz
scummvm-rg350-a3eeebb4d40e176e7f8302c89f2d4065228c79d9.tar.bz2
scummvm-rg350-a3eeebb4d40e176e7f8302c89f2d4065228c79d9.zip
BLADERUNNER: Fix invalid rect in ESPER zoom
In some cornenr case when photo selection is ajdusted the final rectangle might end up invalid and assert will occur. This fixes this issue by correctly setting rect dimensions.
-rw-r--r--engines/bladerunner/ui/esper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/bladerunner/ui/esper.cpp b/engines/bladerunner/ui/esper.cpp
index de41a1958e..fd94977fbc 100644
--- a/engines/bladerunner/ui/esper.cpp
+++ b/engines/bladerunner/ui/esper.cpp
@@ -1765,6 +1765,14 @@ void ESPER::updateSelection() {
}
}
+ if (left > right) {
+ SWAP(left, right);
+ }
+
+ if (top > bottom) {
+ SWAP(top, bottom);
+ }
+
_regionSelected = findRegion(Common::Rect(left, top, right, bottom));
if (_regionSelected >= 0) {
_regionSelectedAck = true;