aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/utils/rectangle.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils/rectangle.hpp b/src/utils/rectangle.hpp
index 81b45905..7297cf47 100644
--- a/src/utils/rectangle.hpp
+++ b/src/utils/rectangle.hpp
@@ -110,6 +110,13 @@ namespace usdx
return Math::min(point1.get_x(), point2.get_x());
}
+ void set_left(T value)
+ {
+ T width = get_width();
+ point1.set_x(value);
+ point2.set_x(value + width);
+ }
+
const T get_right(void) const
{
return Math::max(point1.get_x(), point2.get_x());