From 52f9451bbb216999c0c1d61521b2cb4117781a0b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 27 Jan 2019 16:21:45 -0800 Subject: GLK: Fix Rect fromXYWH when W or H is negative --- engines/glk/utils.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/glk') diff --git a/engines/glk/utils.h b/engines/glk/utils.h index 2532f270a5..0da981abe3 100644 --- a/engines/glk/utils.h +++ b/engines/glk/utils.h @@ -40,6 +40,9 @@ typedef Common::Point Point; struct Rect : public Common::Rect { public: static Rect fromXYWH(int x, int y, int w, int h) { + if (w <= 0 || h <= 0) + return Rect(x, y, x, y); + return Rect(x, y, x + w, y + h); } -- cgit v1.2.3