aboutsummaryrefslogtreecommitdiff
path: root/src/engine/data/bounds.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/data/bounds.cpp')
-rw-r--r--src/engine/data/bounds.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/data/bounds.cpp b/src/engine/data/bounds.cpp
index acd98af..41b6dc0 100644
--- a/src/engine/data/bounds.cpp
+++ b/src/engine/data/bounds.cpp
@@ -32,11 +32,21 @@ CoordsValidation Bounds::validate_coords(const Vector2 &coords) const noexcept
return CoordsValidation::X_HIGH;
}
+ if (static_cast<uint32_t>(coords.get_x()) <= 0)
+ {
+ return CoordsValidation::X_LOW;
+ }
+
if (static_cast<uint32_t>(coords.get_y()) >= _height)
{
return CoordsValidation::Y_HIGH;
}
+ if (static_cast<uint32_t>(coords.get_y()) <= 0)
+ {
+ return CoordsValidation::Y_LOW;
+ }
+
return CoordsValidation::VALID;
}