all repos — mgba @ e9848d87ba2ffdae611324d671959143dc244b23

mGBA Game Boy Advance Emulator

Qt: Improved HiDPI support
Jeffrey Pfau jeffrey@endrift.com
Thu, 05 Jan 2017 00:39:30 -0800
commit

e9848d87ba2ffdae611324d671959143dc244b23

parent

dbbebc45954d881dda066299aa4ce2855935fb8c

3 files changed, 13 insertions(+), 0 deletions(-)

jump to
M CHANGESCHANGES

@@ -3,6 +3,8 @@ Bugfixes:

- ARM7: Fix MLA/*MULL/*MLAL timing - GBA: Fix multiboot ROM loading - Libretro: Fix saving in GB games (fixes mgba.io/i/486) +Misc: + - Qt: Improved HiDPI support 0.5.2: (2016-12-31) Bugfixes:
M src/platform/qt/DisplayGL.cppsrc/platform/qt/DisplayGL.cpp

@@ -75,7 +75,11 @@ mCoreSyncSetVideoSync(&m_context->sync, false);

lockAspectRatio(isAspectRatioLocked()); filter(isFiltered()); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) + messagePainter()->resize(size(), isAspectRatioLocked(), devicePixelRatioF()); +#else messagePainter()->resize(size(), isAspectRatioLocked(), devicePixelRatio()); +#endif resizePainter(); }

@@ -362,7 +366,11 @@ }

void PainterGL::performDraw() { m_painter.beginNativePainting(); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) + float r = m_gl->devicePixelRatioF(); +#else float r = m_gl->devicePixelRatio(); +#endif m_backend->resized(m_backend, m_size.width() * r, m_size.height() * r); m_backend->drawFrame(m_backend); m_painter.endNativePainting();
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -205,6 +205,9 @@ }

void Window::resizeFrame(const QSize& size) { QSize newSize(size); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) + newSize /= m_screenWidget->devicePixelRatioF(); +#endif m_screenWidget->setSizeHint(newSize); newSize -= m_screenWidget->size(); newSize += this->size();