From 819451b6c76bdcaf5fd8865479209859511aa986 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 3 May 2003 17:56:30 +0000 Subject: [PATCH] Reversed the meaning of black and white in wxRegion::ConvertToBitmap so it matches the menaning of black and white in wxMask git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/region.tex | 2 +- include/wx/gtk/region.h | 2 +- include/wx/gtk1/region.h | 2 +- include/wx/mac/region.h | 2 +- include/wx/mgl/region.h | 2 +- include/wx/motif/region.h | 2 +- include/wx/msw/region.h | 2 +- include/wx/x11/region.h | 2 +- src/common/rgncmn.cpp | 4 ++-- src/gtk/toplevel.cpp | 2 +- src/gtk1/toplevel.cpp | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/latex/wx/region.tex b/docs/latex/wx/region.tex index 1f26deea5d..c80bdeb535 100644 --- a/docs/latex/wx/region.tex +++ b/docs/latex/wx/region.tex @@ -97,7 +97,7 @@ all or some part of the region is contained in this region. \constfunc{wxBitmap}{ConvertToBitmap}{} -Convert the region to a black and white bitmap with the black pixels +Convert the region to a black and white bitmap with the white pixels being inside the region. \membersection{wxRegion::GetBox}\label{wxregiongetbox} diff --git a/include/wx/gtk/region.h b/include/wx/gtk/region.h index 03c2844e0b..5ec51def18 100644 --- a/include/wx/gtk/region.h +++ b/include/wx/gtk/region.h @@ -122,7 +122,7 @@ public: wxRegionContain Contains(const wxPoint& pt) const; wxRegionContain Contains(const wxRect& rect) const; - // Convert the region to a B&W bitmap with the black pixels being inside + // Convert the region to a B&W bitmap with the white pixels being inside // the region. wxBitmap ConvertToBitmap() const; diff --git a/include/wx/gtk1/region.h b/include/wx/gtk1/region.h index 03c2844e0b..5ec51def18 100644 --- a/include/wx/gtk1/region.h +++ b/include/wx/gtk1/region.h @@ -122,7 +122,7 @@ public: wxRegionContain Contains(const wxPoint& pt) const; wxRegionContain Contains(const wxRect& rect) const; - // Convert the region to a B&W bitmap with the black pixels being inside + // Convert the region to a B&W bitmap with the white pixels being inside // the region. wxBitmap ConvertToBitmap() const; diff --git a/include/wx/mac/region.h b/include/wx/mac/region.h index 33c31e7d0d..008ed6aa28 100644 --- a/include/wx/mac/region.h +++ b/include/wx/mac/region.h @@ -117,7 +117,7 @@ public: // Does the region contain the rectangle rect? wxRegionContain Contains(const wxRect& rect) const; - // Convert the region to a B&W bitmap with the black pixels being inside + // Convert the region to a B&W bitmap with the white pixels being inside // the region. wxBitmap ConvertToBitmap() const; diff --git a/include/wx/mgl/region.h b/include/wx/mgl/region.h index 3508341a19..440d26c7f5 100644 --- a/include/wx/mgl/region.h +++ b/include/wx/mgl/region.h @@ -103,7 +103,7 @@ public: // Does the region contain the rectangle rect? wxRegionContain Contains(const wxRect& rect) const; - // Convert the region to a B&W bitmap with the black pixels being inside + // Convert the region to a B&W bitmap with the white pixels being inside // the region. wxBitmap ConvertToBitmap() const; diff --git a/include/wx/motif/region.h b/include/wx/motif/region.h index 7e9517c765..ac25f27390 100644 --- a/include/wx/motif/region.h +++ b/include/wx/motif/region.h @@ -107,7 +107,7 @@ public: // Does the region contain the rectangle rect? wxRegionContain Contains(const wxRect& rect) const; - // Convert the region to a B&W bitmap with the black pixels being inside + // Convert the region to a B&W bitmap with the white pixels being inside // the region. wxBitmap ConvertToBitmap() const; diff --git a/include/wx/msw/region.h b/include/wx/msw/region.h index 01f160ba84..ec3529a343 100644 --- a/include/wx/msw/region.h +++ b/include/wx/msw/region.h @@ -114,7 +114,7 @@ public: // Does the region contain the rectangle rect? wxRegionContain Contains(const wxRect& rect) const; - // Convert the region to a B&W bitmap with the black pixels being inside + // Convert the region to a B&W bitmap with the white pixels being inside // the region. wxBitmap ConvertToBitmap() const; diff --git a/include/wx/x11/region.h b/include/wx/x11/region.h index dc04259a34..cfbfe80e2d 100644 --- a/include/wx/x11/region.h +++ b/include/wx/x11/region.h @@ -122,7 +122,7 @@ public: wxRegionContain Contains(const wxPoint& pt) const; wxRegionContain Contains(const wxRect& rect) const; - // Convert the region to a B&W bitmap with the black pixels being inside + // Convert the region to a B&W bitmap with the white pixels being inside // the region. wxBitmap ConvertToBitmap() const; diff --git a/src/common/rgncmn.cpp b/src/common/rgncmn.cpp index 0cf6f5ae06..c192366f29 100644 --- a/src/common/rgncmn.cpp +++ b/src/common/rgncmn.cpp @@ -37,10 +37,10 @@ wxBitmap wxRegion::ConvertToBitmap() const wxBitmap bmp(box.GetRight(), box.GetBottom()); wxMemoryDC dc; dc.SelectObject(bmp); - dc.SetBackground(*wxWHITE_BRUSH); + dc.SetBackground(*wxBLACK_BRUSH); dc.Clear(); dc.SetClippingRegion(*this); - dc.SetBackground(*wxBLACK_BRUSH); + dc.SetBackground(*wxWHITE_BRUSH); dc.Clear(); dc.SelectObject(wxNullBitmap); return bmp; diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 87860da44f..129e4fbb7c 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -989,7 +989,7 @@ static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region) gdk_window_shape_combine_region(window, region.GetRegion(), 0, 0); #else wxBitmap bmp = region.ConvertToBitmap(); - bmp.SetMask(new wxMask(bmp, *wxWHITE)); + bmp.SetMask(new wxMask(bmp, *wxBLACK)); GdkBitmap* mask = bmp.GetMask()->GetBitmap(); gdk_window_shape_combine_mask(window, mask, 0, 0); #endif diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 87860da44f..129e4fbb7c 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -989,7 +989,7 @@ static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region) gdk_window_shape_combine_region(window, region.GetRegion(), 0, 0); #else wxBitmap bmp = region.ConvertToBitmap(); - bmp.SetMask(new wxMask(bmp, *wxWHITE)); + bmp.SetMask(new wxMask(bmp, *wxBLACK)); GdkBitmap* mask = bmp.GetMask()->GetBitmap(); gdk_window_shape_combine_mask(window, mask, 0, 0); #endif -- 2.47.2