summaryrefslogtreecommitdiff
path: root/wx+/dc.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-01-22 13:56:55 -0500
committerB. Stack <bgstack15@gmail.com>2023-01-22 13:56:55 -0500
commit75e05bc441382db69c842a64c562738cb749214e (patch)
tree698b60b3b4b914bf7958cf1174d0373909bf1e8f /wx+/dc.h
parentadd upstream 11.29 (diff)
downloadFreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.gz
FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.bz2
FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.zip
add upstream 12.0
Diffstat (limited to 'wx+/dc.h')
-rw-r--r--wx+/dc.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/wx+/dc.h b/wx+/dc.h
index 48d0fe72..e0cb2c87 100644
--- a/wx+/dc.h
+++ b/wx+/dc.h
@@ -147,6 +147,14 @@ void setScaleFactor(wxDC& dc, double scale)
}
+//add some sanity to moronic const/non-const wxRect::Intersect()
+inline
+wxRect getIntersection(const wxRect& rect1, const wxRect& rect2)
+{
+ return rect1.Intersect(rect2);
+}
+
+
//---------------------- implementation ------------------------
class RecursiveDcClipper
{
@@ -158,8 +166,7 @@ public:
{
oldRect_ = it->second;
- wxRect tmp = r;
- tmp.Intersect(*oldRect_); //better safe than sorry
+ const wxRect tmp = getIntersection(r, *oldRect_); //better safe than sorry
assert(!tmp.IsEmpty()); //"setting an empty clipping region is equivalent to DestroyClippingRegion()"
bgstack15