aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/draci/surface.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp
index 12fabd2ec3..4f97ee75c8 100644
--- a/engines/draci/surface.cpp
+++ b/engines/draci/surface.cpp
@@ -144,6 +144,9 @@ uint Surface::centerOnX(uint x, uint width) const {
if (newX + width >= (uint)w - 1)
newX = (w - 1) - width;
+ if (newX < 0)
+ newX = 0;
+
return newX;
}
@@ -165,6 +168,9 @@ uint Surface::centerOnY(uint y, uint height) const {
if (newY + height >= (uint)h - 1)
newY = (h - 1) - height;
+ if (newY < 0)
+ newY = 0;
+
return newY;
}