summaryrefslogtreecommitdiff
path: root/src/helpers/Vector2D.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Vector2D.cpp')
-rw-r--r--src/helpers/Vector2D.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/helpers/Vector2D.cpp b/src/helpers/Vector2D.cpp
index fb432936..4cd3476b 100644
--- a/src/helpers/Vector2D.cpp
+++ b/src/helpers/Vector2D.cpp
@@ -45,3 +45,7 @@ double Vector2D::distance(const Vector2D& other) const {
double Vector2D::size() const {
return std::sqrt(x * x + y * y);
}
+
+Vector2D Vector2D::getComponentMax(const Vector2D& other) const {
+ return Vector2D(std::max(this->x, other.x), std::max(this->y, other.y));
+}