diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-10-04 10:13:35 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-10-04 10:13:35 +0000 |
commit | 765fa925865bcf8a359d55b7c2ccb3913b4805c8 (patch) | |
tree | 81cc22424cbc7a16280c629306e150b2b3be753e /wx+/dc.h | |
parent | Merge branch '10.15' into 'master' (diff) | |
parent | update bugs.txt after re-release from upstream (diff) | |
download | FreeFileSync-765fa925865bcf8a359d55b7c2ccb3913b4805c8.tar.gz FreeFileSync-765fa925865bcf8a359d55b7c2ccb3913b4805c8.tar.bz2 FreeFileSync-765fa925865bcf8a359d55b7c2ccb3913b4805c8.zip |
Merge branch '10.16' into 'master'10.16
add upstream 10.16
See merge request opensource-tracking/FreeFileSync!13
Diffstat (limited to 'wx+/dc.h')
-rw-r--r-- | wx+/dc.h | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -12,24 +12,25 @@ #include <zen/basic_math.h> #include <wx/dcbuffer.h> //for macro: wxALWAYS_NATIVE_DOUBLE_BUFFER #include <wx/dcscreen.h> + #include <gtk/gtk.h> 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<wxBitmap>& buffer) - }; + class BufferedPaintDC + { + BufferedPaintDC(wxWindow& wnd, std::unique_ptr<wxBitmap>& 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; |