mirror of https://github.com/mgba-emu/mgba.git
Qt: Improved HiDPI support
This commit is contained in:
parent
b5b559498b
commit
c621677a6a
1
CHANGES
1
CHANGES
|
@ -39,6 +39,7 @@ Misc:
|
|||
- All: Add C++ header guards
|
||||
- GBA I/O: Clear JOYSTAT RECV flag when reading JOY_RECV registers
|
||||
- GBA I/O: Set JOYSTAT TRANS flag when writing JOY_TRANS registers
|
||||
- Qt: Improved HiDPI support
|
||||
|
||||
0.5.2: (2016-12-31)
|
||||
Bugfixes:
|
||||
|
|
|
@ -73,7 +73,11 @@ void DisplayGL::startDrawing(mCoreThread* thread) {
|
|||
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -360,7 +364,11 @@ void PainterGL::unpause() {
|
|||
|
||||
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();
|
||||
|
|
|
@ -210,6 +210,9 @@ void Window::argumentsPassed(mArguments* args) {
|
|||
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue