From 89621addb4a7c87d2e3f3e7462e3c690cf71de71 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Wed, 16 Mar 2016 21:31:24 +0100 Subject: 7.6 --- wx+/dc.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'wx+/dc.h') diff --git a/wx+/dc.h b/wx+/dc.h index 3fba4aaf..568da47b 100644 --- a/wx+/dc.h +++ b/wx+/dc.h @@ -4,10 +4,11 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef DC_3813704987123956832143243214 -#define DC_3813704987123956832143243214 +#ifndef DC_H_4987123956832143243214 +#define DC_H_4987123956832143243214 #include +#include #include //for macro: wxALWAYS_NATIVE_DOUBLE_BUFFER namespace zen @@ -48,7 +49,7 @@ public: auto it = refDcToAreaMap().find(&dc); if (it != refDcToAreaMap().end()) { - oldRect = std::make_unique(it->second); + oldRect = it->second; wxRect tmp = r; tmp.Intersect(*oldRect); //better safe than sorry @@ -65,7 +66,7 @@ public: ~RecursiveDcClipper() { dc_.DestroyClippingRegion(); - if (oldRect.get() != nullptr) + if (oldRect) { dc_.SetClippingRegion(*oldRect); refDcToAreaMap()[&dc_] = *oldRect; @@ -78,7 +79,7 @@ private: //associate "active" clipping area with each DC static std::unordered_map& refDcToAreaMap() { static std::unordered_map clippingAreas; return clippingAreas; } - std::unique_ptr oldRect; + Opt oldRect; wxDC& dc_; }; @@ -88,17 +89,17 @@ private: #endif #if wxALWAYS_NATIVE_DOUBLE_BUFFER -struct BufferedPaintDC : public wxPaintDC { BufferedPaintDC(wxWindow& wnd, std::unique_ptr& buffer) : wxPaintDC(&wnd) {} }; +struct BufferedPaintDC : public wxPaintDC { BufferedPaintDC(wxWindow& wnd, Opt& buffer) : wxPaintDC(&wnd) {} }; #else class BufferedPaintDC : public wxMemoryDC { public: - BufferedPaintDC(wxWindow& wnd, std::unique_ptr& buffer) : buffer_(buffer), paintDc(&wnd) + BufferedPaintDC(wxWindow& wnd, Opt& buffer) : buffer_(buffer), paintDc(&wnd) { const wxSize clientSize = wnd.GetClientSize(); if (!buffer_ || clientSize != wxSize(buffer->GetWidth(), buffer->GetHeight())) - buffer = std::make_unique(clientSize.GetWidth(), clientSize.GetHeight()); + buffer = wxBitmap(clientSize.GetWidth(), clientSize.GetHeight()); SelectObject(*buffer); @@ -119,10 +120,10 @@ public: } private: - std::unique_ptr& buffer_; + Opt& buffer_; wxPaintDC paintDc; }; #endif } -#endif //DC_3813704987123956832143243214 +#endif //DC_H_4987123956832143243214 -- cgit