From d0697d980120a8a80cdf9840c54fdd4d3165a038 Mon Sep 17 00:00:00 2001 From: Player701 <{ID}+{username}@users.noreply.github.com> Date: Thu, 25 Nov 2021 16:14:01 +0300 Subject: [PATCH] - Fixed some issues with the scaling feature of DStatusBarCore::DrawString --- src/common/statusbar/base_sbar.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/statusbar/base_sbar.cpp b/src/common/statusbar/base_sbar.cpp index 9ea4a6d26..0ee2f7701 100644 --- a/src/common/statusbar/base_sbar.cpp +++ b/src/common/statusbar/base_sbar.cpp @@ -754,7 +754,7 @@ void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, d { if (ch == ' ') { - x += monospaced ? spacing : font->GetSpaceWidth() + spacing; + x += (monospaced ? spacing : font->GetSpaceWidth() + spacing) * scaleX; continue; } else if (ch == TEXTCOLOR_ESCAPE) @@ -774,7 +774,7 @@ void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, d width += font->GetDefaultKerning(); if (!monospaced) //If we are monospaced lets use the offset - x += (c->GetDisplayLeftOffset() + 1); //ignore x offsets since we adapt to character size + x += c->GetDisplayLeftOffset() * scaleX + 1; //ignore x offsets since we adapt to character size double rx, ry, rw, rh; rx = x + drawOffset.X; @@ -825,12 +825,12 @@ void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, d DTA_LegacyRenderStyle, ERenderStyle(style), TAG_DONE); - dx = monospaced - ? spacing - : width + spacing - (c->GetDisplayLeftOffset() + 1); - // Take text scale into account - x += dx * scaleX; + dx = monospaced + ? spacing * scaleX + : (double(width) + spacing - c->GetDisplayLeftOffset()) * scaleX - 1; + + x += dx; } }