X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/461e93f921df33c09637db5dddcfd07411ff0ded..a83ea9c15a7ac7bbdc6686164cfcbbc21ae5031a:/src/x11/region.cpp diff --git a/src/x11/region.cpp b/src/x11/region.cpp index a8f536416b..78be859708 100644 --- a/src/x11/region.cpp +++ b/src/x11/region.cpp @@ -1,14 +1,14 @@ ///////////////////////////////////////////////////////////////////////////// // File: region.cpp // Purpose: Region class -// Author: Markus Holzem, Julian Smart, Robert Roebling +// Author: Julian Smart, Robert Roebling // Created: Fri Oct 24 10:46:34 MET 1997 -// RCS-ID: $Id$ -// Copyright: (c) 1997 Markus Holzem, Julian Smart, Robert Roebling +// RCS-ID: $Id$ +// Copyright: (c) 1997 Julian Smart, Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "region.h" #endif @@ -149,6 +149,12 @@ void wxRegion::Clear() 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; @@ -434,13 +440,13 @@ public: wxRIRefData::~wxRIRefData() { - delete m_rects; + delete [] m_rects; } void wxRIRefData::CreateRects( const wxRegion& region ) { if (m_rects) - delete m_rects; + delete [] m_rects; m_rects = 0; m_numRects = 0;