From ab8938a6950f613c0f255788b483ef683e5e0851 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Tue, 26 Dec 2023 19:32:38 +0100 Subject: fix OSD scaling on hiDPI screens --- src/frontend/qt_sdl/OSD.cpp | 4 ++-- src/frontend/qt_sdl/OSD.h | 2 +- src/frontend/qt_sdl/Screen.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/frontend/qt_sdl/OSD.cpp b/src/frontend/qt_sdl/OSD.cpp index 25072df..3734b76 100644 --- a/src/frontend/qt_sdl/OSD.cpp +++ b/src/frontend/qt_sdl/OSD.cpp @@ -418,7 +418,7 @@ void DrawNative(QPainter& painter) Rendering.unlock(); } -void DrawGL(float w, float h) +void DrawGL(float w, float h, float factor) { if (!Config::ShowOSD) return; if (!mainWindow || !mainWindow->panel) return; @@ -430,7 +430,7 @@ void DrawGL(float w, float h) glUseProgram(Shader[2]); glUniform2f(uScreenSize, w, h); - glUniform1f(uScaleFactor, mainWindow->devicePixelRatioF()); + glUniform1f(uScaleFactor, factor); glBindBuffer(GL_ARRAY_BUFFER, OSDVertexBuffer); glBindVertexArray(OSDVertexArray); diff --git a/src/frontend/qt_sdl/OSD.h b/src/frontend/qt_sdl/OSD.h index 64131d5..c907a0b 100644 --- a/src/frontend/qt_sdl/OSD.h +++ b/src/frontend/qt_sdl/OSD.h @@ -32,7 +32,7 @@ void AddMessage(u32 color, const char* text); void Update(); void DrawNative(QPainter& painter); -void DrawGL(float w, float h); +void DrawGL(float w, float h, float factor); } diff --git a/src/frontend/qt_sdl/Screen.cpp b/src/frontend/qt_sdl/Screen.cpp index 35be7e6..d8af662 100644 --- a/src/frontend/qt_sdl/Screen.cpp +++ b/src/frontend/qt_sdl/Screen.cpp @@ -591,7 +591,7 @@ void ScreenPanelGL::drawScreenGL() screenSettingsLock.unlock(); OSD::Update(); - OSD::DrawGL(w, h); + OSD::DrawGL(w, h, factor); glContext->SwapBuffers(); } -- cgit v1.2.3