[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/lib/kofficeui
From: Thomas Zander <zander () kde ! org>
Date: 2005-10-27 19:18:02
Message-ID: 1130440682.096515.10457.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 474964 by zander:
Remove legacy bool argument for the contains().
Add DOX
M +6 -18 koRect.cpp
M +13 -3 koRect.h
--- trunk/koffice/lib/kofficeui/koRect.cpp #474963:474964
@@ -143,28 +143,16 @@
return *this;
}
-bool KoRect::contains(const KoPoint &p, bool proper) const {
-
- if(proper)
- return (p.x() > m_tl.x() && p.x() < m_br.x() && p.y() > m_tl.y() && p.y() < \
m_br.y());
- else
- return (p.x() >= m_tl.x() && p.x() <= m_br.x() && p.y() >= m_tl.y() && p.y() \
<= m_br.y()); +bool KoRect::contains(const KoPoint &p) const {
+ return (p.x() >= m_tl.x() && p.x() <= m_br.x() && p.y() >= m_tl.y() && p.y() <= \
m_br.y()); }
-bool KoRect::contains(const double &x, const double &y, bool proper) const {
-
- if(proper)
- return (x > m_tl.x() && x < m_br.x() && y > m_tl.y() && y < m_br.y());
- else
- return (x >= m_tl.x() && x <= m_br.x() && y >= m_tl.y() && y <= m_br.y());
+bool KoRect::contains(const double &x, const double &y) const {
+ return (x >= m_tl.x() && x <= m_br.x() && y >= m_tl.y() && y <= m_br.y());
}
-bool KoRect::contains(const KoRect &r, bool proper) const {
-
- if(proper)
- return (r.left() > m_tl.x() && r.right() < m_br.x() && r.top() > m_tl.y() && \
r.bottom() < m_br.y());
- else
- return (r.left() >= m_tl.x() && r.right() <= m_br.x() && r.top() >= m_tl.y() \
&& r.bottom() <= m_br.y()); +bool KoRect::contains(const KoRect &r) const {
+ return (r.left() >= m_tl.x() && r.right() <= m_br.x() && r.top() >= m_tl.y() && \
r.bottom() <= m_br.y()); }
--- trunk/koffice/lib/kofficeui/koRect.h #474963:474964
@@ -95,9 +95,19 @@
KoRect &operator|=(const KoRect &rhs);
KoRect &operator&=(const KoRect &rhs);
- bool contains(const KoPoint &p, bool proper=false) const;
- bool contains(const double &x, const double &y, bool proper=false) const;
- bool contains(const KoRect &r, bool proper=false) const;
+ /**
+ * Returns if the point is contained in the rect.
+ * @param p the point to test
+ * Will return true if the point is contained in the 2d area this rect \
represents, this means + * that it will return true on everthing from the \
topleft() to the bottomright(); + * Note that for KoRect(0, 0, 100, 100) the \
KoPoint(0, 0) as well as KoPoint(100, 100) are + * mathmatically contained in the \
rect, this in contrary to pixel based rectangles. + */
+ bool contains(const KoPoint &p) const;
+ /// Helper function for the above function.
+ bool contains(const double &x, const double &y) const;
+ /// Helper function for the above function.
+ bool contains(const KoRect &r) const;
KoRect unite(const KoRect &r) const;
KoRect intersect(const KoRect &r) const;
bool intersects(const KoRect &r) const;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic