From 81bd7930164b79a841b03e4a8a1937e5aeb3ab54 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 20 Mar 2014 00:58:11 +0300 Subject: Improve rect. --- src/gui/rect.cpp | 14 +------------- src/gui/rect.h | 11 +---------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/gui/rect.cpp b/src/gui/rect.cpp index 5f9d2bf0f..3f59d94cb 100644 --- a/src/gui/rect.cpp +++ b/src/gui/rect.cpp @@ -135,22 +135,10 @@ bool Rect::isIntersecting(const Rect& rectangle) const return true; } -bool Rect::isPointInRect(int x_, int y_) const +bool Rect::isPointInRect(const int x_, const int y_) const { return x_ >= x && y_ >= y && x_ < x + width && y_ < y + height; } - -std::ostream& operator<<(std::ostream& out, - const Rect& rectangle) -{ - out << "Rect [x = " << rectangle.x - << ", y = " << rectangle.y - << ", width = " << rectangle.width - << ", height = " << rectangle.height - << "]"; - - return out; -} diff --git a/src/gui/rect.h b/src/gui/rect.h index 69c0120ca..8b570a9f7 100644 --- a/src/gui/rect.h +++ b/src/gui/rect.h @@ -127,16 +127,7 @@ class Rect * @return True if the point is inside the rectangle. * @since 0.1.0 */ - bool isPointInRect(int x, int y) const A_WARN_UNUSED; - - /** - * Output operator for output. - * - * @param out The stream to output to. - * @param rectangle The rectangle to output. - */ - friend std::ostream& operator<<(std::ostream& out, - const Rect& rectangle); + bool isPointInRect(const int x, const int y) const A_WARN_UNUSED; /** * Holds the x coordinate of the rectangle. -- cgit v1.2.3-60-g2f50