summaryrefslogtreecommitdiff
path: root/wx+/dc.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-11-02 12:45:42 +0000
committerB Stack <bgstack15@gmail.com>2020-11-02 12:45:42 +0000
commit3162cbdd63eaf7e930c8b2ebe604e10ecb369d08 (patch)
tree9939cdd1735bf15e97ad6700419c0604cac7c59e /wx+/dc.h
parentMerge branch '11.2' into 'master' (diff)
parentadd upstream 11.3 (diff)
downloadFreeFileSync-3162cbdd63eaf7e930c8b2ebe604e10ecb369d08.tar.gz
FreeFileSync-3162cbdd63eaf7e930c8b2ebe604e10ecb369d08.tar.bz2
FreeFileSync-3162cbdd63eaf7e930c8b2ebe604e10ecb369d08.zip
Merge branch '11.3' into 'master'11.3
add upstream 11.3 See merge request opensource-tracking/FreeFileSync!27
Diffstat (limited to 'wx+/dc.h')
-rw-r--r--wx+/dc.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/wx+/dc.h b/wx+/dc.h
index d4b68109..d803f04d 100644
--- a/wx+/dc.h
+++ b/wx+/dc.h
@@ -39,8 +39,8 @@ void clearArea(wxDC& dc, const wxRect& rect, const wxColor& col)
{
//wxDC::DrawRectangle() just widens inner area if wxTRANSPARENT_PEN is used!
//bonus: wxTRANSPARENT_PEN is about 2x faster than redundantly drawing with col!
- wxDCPenChanger dummy (dc, *wxTRANSPARENT_PEN);
- wxDCBrushChanger dummy2(dc, col);
+ wxDCPenChanger areaPen (dc, *wxTRANSPARENT_PEN);
+ wxDCBrushChanger areaBrush(dc, col);
dc.DrawRectangle(rect);
}
}
@@ -51,8 +51,8 @@ inline
void drawFilledRectangle(wxDC& dc, wxRect rect, int borderWidth, const wxColor& borderCol, const wxColor& innerCol)
{
assert(borderCol.IsSolid() && innerCol.IsSolid());
- wxDCPenChanger graphPen (dc, *wxTRANSPARENT_PEN);
- wxDCBrushChanger graphBrush(dc, borderCol);
+ wxDCPenChanger rectPen (dc, *wxTRANSPARENT_PEN);
+ wxDCBrushChanger rectBrush(dc, borderCol);
dc.DrawRectangle(rect);
rect.Deflate(borderWidth); //attention, more wxWidgets design mistakes: behavior of wxRect::Deflate depends on object being const/non-const!!!
@@ -93,8 +93,11 @@ public:
oldRect_ = it->second;
wxRect tmp = r;
- tmp.Intersect(*oldRect_); //better safe than sorry
- dc_.SetClippingRegion(tmp); //
+ tmp.Intersect(*oldRect_); //better safe than sorry
+
+ assert(!tmp.IsEmpty()); //"setting an empty clipping region is equivalent to DestroyClippingRegion()"
+
+ dc_.SetClippingRegion(tmp); //new clipping region is intersection of given and previously set regions
it->second = tmp;
}
else
bgstack15