Skip to content

Commit

Permalink
fix OSD scaling on hiDPI screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisotura committed Dec 26, 2023
1 parent f905b6f commit ab8938a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/frontend/qt_sdl/OSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/qt_sdl/OSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/qt_sdl/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ void ScreenPanelGL::drawScreenGL()
screenSettingsLock.unlock();

OSD::Update();
OSD::DrawGL(w, h);
OSD::DrawGL(w, h, factor);

glContext->SwapBuffers();
}
Expand Down

0 comments on commit ab8938a

Please sign in to comment.