From: Vadim Zeitlin Date: Thu, 5 Sep 2002 10:54:30 +0000 (+0000) Subject: fix Union(empty rect) bug X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/57351df0a60b1f2302f66a8d687285c3f5a54fd0?ds=sidebyside fix Union(empty rect) bug git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index e1394a48b4..7ca7653e2a 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -185,6 +185,12 @@ void wxRegion::Clear() bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) { + // workaround for a strange GTK/X11 bug: taking union with an empty + // rectangle results in an empty region which is definitely not what we + // want + if ( !width || !height ) + return TRUE; + GdkRectangle rect; rect.x = x; rect.y = y; diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp index e1394a48b4..7ca7653e2a 100644 --- a/src/gtk1/region.cpp +++ b/src/gtk1/region.cpp @@ -185,6 +185,12 @@ void wxRegion::Clear() bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) { + // workaround for a strange GTK/X11 bug: taking union with an empty + // rectangle results in an empty region which is definitely not what we + // want + if ( !width || !height ) + return TRUE; + GdkRectangle rect; rect.x = x; rect.y = y;