rtext: fix dpi bug

This commit is contained in:
Sergei Baigerov 2024-02-19 23:11:43 +08:00 committed by GitHub
parent 0a50c259db
commit f31dc23a3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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