From a1cb2eb12a0ea295deb1d13afcba5ce566849ed6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 25 Jan 2018 14:55:31 +0100 Subject: [PATCH] Also return display DPI from wxScreenDC in wxGTK3 This is similar to the previous commit and is done for the same reasons: screen DC needs to use the same DPI as the screen itself, instead of the default Cairo 72 DPI. --- include/wx/gtk/dc.h | 2 ++ src/gtk/dc.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/wx/gtk/dc.h b/include/wx/gtk/dc.h index de09ee2494..3e3b600f68 100644 --- a/include/wx/gtk/dc.h +++ b/include/wx/gtk/dc.h @@ -76,6 +76,8 @@ class wxScreenDCImpl: public wxGTKCairoDCImpl public: wxScreenDCImpl(wxScreenDC* owner); + virtual wxSize GetPPI() const wxOVERRIDE; + wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl); }; //----------------------------------------------------------------------------- diff --git a/src/gtk/dc.cpp b/src/gtk/dc.cpp index ed846c0899..ccd61f9b02 100644 --- a/src/gtk/dc.cpp +++ b/src/gtk/dc.cpp @@ -364,6 +364,12 @@ wxScreenDCImpl::wxScreenDCImpl(wxScreenDC* owner) gc->EnableOffset(m_contentScaleFactor <= 1); SetGraphicsContext(gc); } + +wxSize wxScreenDCImpl::GetPPI() const +{ + return wxGetDisplayPPI(); +} + //----------------------------------------------------------------------------- wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC* owner)