From a3eeebb4d40e176e7f8302c89f2d4065228c79d9 Mon Sep 17 00:00:00 2001 From: Peter Kohaut Date: Thu, 30 May 2019 23:25:11 +0200 Subject: 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. --- engines/bladerunner/ui/esper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/bladerunner') 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; -- cgit v1.2.3