From bf9eacad162fd0380e4dca4fcf3028eba03e0bb1 Mon Sep 17 00:00:00 2001 From: Sean D'Epagnier Date: Mon, 12 Sep 2016 11:58:47 -0400 Subject: [PATCH] correct ppi implementation in wxqtdc --- src/qt/dc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index e84e1c6abd..977142be7c 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -133,9 +133,10 @@ int wxQtDCImpl::GetDepth() const wxSize wxQtDCImpl::GetPPI() const { QScreen *srn = QApplication::screens().at(0); - qreal dotsPerInch = (qreal)srn->logicalDotsPerInch(); + if (!srn) + return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY()); + qreal dotsPerInch = srn->logicalDotsPerInch(); return wxSize(round(dotsPerInch), round(dotsPerInch)); -// return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY()); } void wxQtDCImpl::SetFont(const wxFont& font)