diff options
Diffstat (limited to '')
-rw-r--r-- | src/utils/rectangle.hpp | 15 |
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 |