X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b3a7510d21b9d4f9646b32edf9fe6f453f2c6dc9..81b41c03c6bcbffa9293a0e280729ffaaf9ef2c7:/src/motif/region.cpp?ds=sidebyside diff --git a/src/motif/region.cpp b/src/motif/region.cpp index fb3b1e3db2..db2d97d6db 100644 --- a/src/motif/region.cpp +++ b/src/motif/region.cpp @@ -82,10 +82,10 @@ public: void wxRegionRefData::SetRects(const wxRectList& rectList) { DeleteRects(); - m_usingRects = (rectList.Number() > 0); + m_usingRects = (rectList.GetCount() > 0); if (m_usingRects) { - m_rectCount = rectList.Number(); + m_rectCount = rectList.GetCount(); m_rects = new wxRect[m_rectCount]; } @@ -200,8 +200,17 @@ void wxRegion::Clear() } //! Combine rectangle (x, y, w, h) with this. -bool wxRegion::Combine(wxCoord x, wxCoord y, wxCoord width, wxCoord height, wxRegionOp op) +bool +wxRegion::Combine(wxCoord x, wxCoord y, + wxCoord width, wxCoord height, + wxRegionOp op) { + // work around for XUnionRectWithRegion() bug: taking a union with an empty + // rect results in an empty region (at least XFree 3.3.6 and 4.0 have this + // problem) + if ( op == wxRGN_OR && (!width || !height) ) + return TRUE; + // Don't change shared data if (!m_refData) { m_refData = new wxRegionRefData();