X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ccf6cd7ea228a58ac43989760651796ec8d8600..01cb1c26171efc494b94d77e4351362bb0eb2e7d:/src/motif/region.cpp?ds=sidebyside diff --git a/src/motif/region.cpp b/src/motif/region.cpp index f9e7e47413..1bec3f26ce 100644 --- a/src/motif/region.cpp +++ b/src/motif/region.cpp @@ -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(); @@ -462,8 +471,7 @@ void wxRegionIterator::Reset(const wxRegion& region) m_numRects = count; m_rects = new wxRect[m_numRects]; - int i = 0; - for (i = 0; i < m_numRects; i++) + for (size_t i = 0; i < m_numRects; i++) m_rects[i] = rects[i]; /*