aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/graphics')
-rw-r--r--src/engine/graphics/string_matrix.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/engine/graphics/string_matrix.cpp b/src/engine/graphics/string_matrix.cpp
index b1db334..26d48df 100644
--- a/src/engine/graphics/string_matrix.cpp
+++ b/src/engine/graphics/string_matrix.cpp
@@ -22,12 +22,18 @@ void StringMatrix::fill(std::string_view element)
std::string_view StringMatrix::get(const Vector2 &pos) const
{
- return _matrix[pos.get_y()][pos.get_x()];
+ auto x = static_cast<std::size_t>(pos.get_x());
+ auto y = static_cast<std::size_t>(pos.get_y());
+
+ return _matrix[y][x];
}
void StringMatrix::set(const Vector2 &pos, std::string_view element)
{
- _matrix[pos.get_y()][pos.get_x()] = element;
+ auto x = static_cast<std::size_t>(pos.get_x());
+ auto y = static_cast<std::size_t>(pos.get_y());
+
+ _matrix[y][x] = element;
}
uint32_t StringMatrix::rows() const