From ca250bf14979d359a82d5baf11ae9587d5605594 Mon Sep 17 00:00:00 2001 From: B Stack Date: Tue, 17 Sep 2019 08:06:14 -0400 Subject: add upstream 10.16 --- wx+/dc.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'wx+/dc.h') diff --git a/wx+/dc.h b/wx+/dc.h index bcf62a14..894fb473 100644 --- a/wx+/dc.h +++ b/wx+/dc.h @@ -12,24 +12,25 @@ #include #include //for macro: wxALWAYS_NATIVE_DOUBLE_BUFFER #include + #include namespace zen { /* - 1. wxDCClipper does *not* stack: another fix for yet another poor wxWidgets implementation + 1. wxDCClipper does *not* stack: another fix for yet another poor wxWidgets implementation - class RecursiveDcClipper - { - RecursiveDcClipper(wxDC& dc, const wxRect& r) - }; + class RecursiveDcClipper + { + RecursiveDcClipper(wxDC& dc, const wxRect& r) + }; - 2. wxAutoBufferedPaintDC skips one pixel on left side when RTL layout is active: a fix for a poor wxWidgets implementation + 2. wxAutoBufferedPaintDC skips one pixel on left side when RTL layout is active: a fix for a poor wxWidgets implementation - class BufferedPaintDC - { - BufferedPaintDC(wxWindow& wnd, std::unique_ptr& buffer) - }; + class BufferedPaintDC + { + BufferedPaintDC(wxWindow& wnd, std::unique_ptr& buffer) + }; */ @@ -50,10 +51,12 @@ Standard DPI: inline int fastFromDIP(int d) //like wxWindow::FromDIP (but tied to primary monitor and buffered) { - #ifdef wxHAVE_DPI_INDEPENDENT_PIXELS //pulled from wx/window.h: https://github.com/wxWidgets/wxWidgets/blob/master/include/wx/window.h#L2029 return d; //e.g. macOS, GTK3 #else //https://github.com/wxWidgets/wxWidgets/blob/master/src/common/wincmn.cpp#L2865 + static_assert(GTK_MAJOR_VERSION == 2); + //GTK2 doesn't properly support high DPI: https://freefilesync.org/forum/viewtopic.php?t=6114 + //=> requires general fix at wxWidgets-level assert(wxTheApp); //only call after wxWidgets was initalized! static const int dpiY = wxScreenDC().GetPPI().y; //perf: buffering for calls to ::GetDeviceCaps() needed!? const int defaultDpi = 96; -- cgit