aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-11-23 20:46:05 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-18 19:34:20 +0100
commit6901f994667dbc2fd18eb23bb4ed1aae88929200 (patch)
tree6e77dd12a6f663d1381e0719aeecb9436fed7759
parent48bc8dd33e38de832d4c23dbc3c4d45d03f9a55d (diff)
downloadusdx-6901f994667dbc2fd18eb23bb4ed1aae88929200.tar.gz
usdx-6901f994667dbc2fd18eb23bb4ed1aae88929200.tar.xz
usdx-6901f994667dbc2fd18eb23bb4ed1aae88929200.zip
utils/rectangle: add set_left
Diffstat (limited to '')
-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());