]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/region.cpp
Ambiguous overload fix for gcc
[wxWidgets.git] / src / x11 / region.cpp
index 1f7f4d5929a542e77593410cf59e19fee0f42b15..babe1dcca1c84b943960dc5a8779299af8549067 100644 (file)
@@ -1,17 +1,13 @@
 /////////////////////////////////////////////////////////////////////////////
 // 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__
-#pragma implementation "region.h"
-#endif
-
 #include "wx/region.h"
 #include "wx/gdicmn.h"
 #include "wx/log.h"
@@ -127,7 +123,7 @@ wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
 // wxRegion comparison
 // ----------------------------------------------------------------------------
 
-bool wxRegion::operator==( const wxRegion& region )
+bool wxRegion::operator==( const wxRegion& region ) const
 {
     if (m_refData == region.m_refData) return TRUE;
 
@@ -149,6 +145,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;