summaryrefslogtreecommitdiff
path: root/wx+/dc.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-11-01 17:16:37 -0500
committerB Stack <bgstack15@gmail.com>2020-11-01 17:16:37 -0500
commit2a57306c461964f860ba1cb51f1bf96c954173e0 (patch)
tree9939cdd1735bf15e97ad6700419c0604cac7c59e /wx+/dc.h
parentMerge branch '11.2' into 'master' (diff)
downloadFreeFileSync-2a57306c461964f860ba1cb51f1bf96c954173e0.tar.gz
FreeFileSync-2a57306c461964f860ba1cb51f1bf96c954173e0.tar.bz2
FreeFileSync-2a57306c461964f860ba1cb51f1bf96c954173e0.zip
add upstream 11.3
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