aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/rectangle.hpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-04-03 02:13:32 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2015-04-03 02:13:32 +0200
commitad8586d69bdac1a1fa19907f830518875e4acd91 (patch)
treec8052c43cb1754c2ae99c227c7dc61ee309d8a12 /src/utils/rectangle.hpp
parent82cc9c0cf2cdb8de17233a2ea943a5247d5da305 (diff)
downloadusdx-ad8586d69bdac1a1fa19907f830518875e4acd91.tar.gz
usdx-ad8586d69bdac1a1fa19907f830518875e4acd91.tar.xz
usdx-ad8586d69bdac1a1fa19907f830518875e4acd91.zip
utils/math: Remove custom implementation of min/max.
The stl provieds sutable implementations.
Diffstat (limited to '')
-rw-r--r--src/utils/rectangle.hpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/utils/rectangle.hpp b/src/utils/rectangle.hpp
index 9cca9eff..423f309f 100644
--- a/src/utils/rectangle.hpp
+++ b/src/utils/rectangle.hpp
@@ -25,9 +25,10 @@
#ifndef RECTANGLE_HPP
#define RECTANGLE_HPP
+#include <algorithm>
+
#include "point.hpp"
#include "dimension.hpp"
-#include "math.hpp"
namespace usdx
{
@@ -80,17 +81,17 @@ namespace usdx
const T get_width(void) const
{
- return Math::abs(point2.get_x() - point1.get_x());
+ return std::abs(point2.get_x() - point1.get_x());
}
const T get_height(void) const
{
- return Math::abs(point2.get_y() - point1.get_y());
+ return std::abs(point2.get_y() - point1.get_y());
}
const T get_top(void) const
{
- return Math::min(point1.get_y(), point2.get_y());
+ return std::min(point1.get_y(), point2.get_y());
}
void set_top(T value)
@@ -102,12 +103,12 @@ namespace usdx
const T get_bottom(void) const
{
- return Math::max(point1.get_y(), point2.get_y());
+ return std::max(point1.get_y(), point2.get_y());
}
const T get_left(void) const
{
- return Math::min(point1.get_x(), point2.get_x());
+ return std::min(point1.get_x(), point2.get_x());
}
void set_left(T value)
@@ -124,7 +125,7 @@ namespace usdx
const T get_right(void) const
{
- return Math::max(point1.get_x(), point2.get_x());
+ return std::max(point1.get_x(), point2.get_x());
}
const Rectangle<T> intersect(const Rectangle<T>& inner) const