From f31dc23a3fd5207901a0dd8b1596b73e9ee4dbe5 Mon Sep 17 00:00:00 2001 From: Sergei Baigerov Date: Mon, 19 Feb 2024 23:11:43 +0800 Subject: [PATCH] rtext: fix dpi bug --- src/rtext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index eb56b3ecd..2145ae18e 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1156,6 +1156,8 @@ void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, f float scaleFactor = fontSize/font.baseSize; // Character quad scaling factor + float dpiFactorY = GetWindowScaleDPI().y; // Window scale DPI factor (Y) + for (int i = 0; i < size;) { // Get next codepoint from byte string and glyph index in font @@ -1166,7 +1168,7 @@ void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, f if (codepoint == '\n') { // NOTE: Line spacing is a global variable, use SetTextLineSpacing() to setup - textOffsetY += textLineSpacing; + textOffsetY += textLineSpacing * dpiFactorY; textOffsetX = 0.0f; } else