git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17046
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
}
//! Combine rectangle (x, y, w, h) with this.
}
//! 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();
// Don't change shared data
if (!m_refData) {
m_refData = new wxRegionRefData();
bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
+ // 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 ( !width || !height )
+ return TRUE;
+
XRectangle rect;
rect.x = x;
rect.y = y;
XRectangle rect;
rect.x = x;
rect.y = y;