aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorPaul Gilbert2019-01-27 16:21:45 -0800
committerPaul Gilbert2019-01-29 21:17:17 -0800
commit52f9451bbb216999c0c1d61521b2cb4117781a0b (patch)
tree1f2ea9a84ddb0bb1b2f0c6366ddee7de2e1890b4 /engines/glk
parentbce294cd79dfdec0a630b45fda2147b79cb8abb4 (diff)
downloadscummvm-rg350-52f9451bbb216999c0c1d61521b2cb4117781a0b.tar.gz
scummvm-rg350-52f9451bbb216999c0c1d61521b2cb4117781a0b.tar.bz2
scummvm-rg350-52f9451bbb216999c0c1d61521b2cb4117781a0b.zip
GLK: Fix Rect fromXYWH when W or H is negative
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/utils.h3
1 files changed, 3 insertions, 0 deletions
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);
}