use wxIsSameDouble() and wxIsNullDouble() for warning-less double comparison of doubles

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-09-25 23:27:27 +00:00
parent f1afd2e066
commit c77a67962c
14 changed files with 139 additions and 127 deletions

View File

@@ -449,12 +449,12 @@ inline wxPoint2DDouble& wxPoint2DDouble::operator/=(const wxPoint2DDouble& pt)
inline bool wxPoint2DDouble::operator==(const wxPoint2DDouble& pt) const
{
return m_x == pt.m_x && m_y == pt.m_y;
return wxIsSameDouble(m_x, pt.m_x) && wxIsSameDouble(m_y, pt.m_y);
}
inline bool wxPoint2DDouble::operator!=(const wxPoint2DDouble& pt) const
{
return m_x != pt.m_x || m_y != pt.m_y;
return !(*this == pt);
}
inline wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
@@ -590,9 +590,9 @@ public:
{ return ( ( ( m_x <= rect.m_x ) && ( rect.m_x + rect.m_width <= m_x + m_width ) ) &&
( ( m_y <= rect.m_y ) && ( rect.m_y + rect.m_height <= m_y + m_height ) ) ); }
inline bool IsEmpty() const
{ return ( m_width <= 0 || m_height <= 0 ); }
{ return m_width <= 0 || m_height <= 0; }
inline bool HaveEqualSize( const wxRect2DDouble &rect ) const
{ return ( rect.m_width == m_width && rect.m_height == m_height ); }
{ return wxIsSameDouble(rect.m_width, m_width) && wxIsSameDouble(rect.m_height, m_height); }
inline void Inset( wxDouble x , wxDouble y )
{ m_x += x; m_y += y; m_width -= 2 * x; m_height -= 2 * y; }
@@ -628,7 +628,7 @@ public:
wxRect2DDouble& operator = (const wxRect2DDouble& rect);
inline bool operator == (const wxRect2DDouble& rect) const
{ return (m_x==rect.m_x && m_y==rect.m_y && m_width==rect.m_width && m_height==rect.m_height); }
{ return wxIsSameDouble(m_x, rect.m_x) && wxIsSameDouble(m_y, rect.m_y) && HaveEqualSize(rect); }
inline bool operator != (const wxRect2DDouble& rect) const
{ return !(*this == rect); }