Skip to content

Commit

Permalink
- Fixed some issues with the scaling feature of DStatusBarCore::DrawS…
Browse files Browse the repository at this point in the history
…tring
  • Loading branch information
Player701 authored and coelckers committed Nov 25, 2021
1 parent 54ad343 commit d0697d9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/common/statusbar/base_sbar.cpp
Expand Up @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -825,12 +825,12 @@ void DStatusBarCore::DrawString(FFont* font, const FString& cstring, double x, d
DTA_LegacyRenderStyle, ERenderStyle(style),
TAG_DONE);

// Take text scale into account
dx = monospaced
? spacing
: width + spacing - (c->GetDisplayLeftOffset() + 1);
? spacing * scaleX
: (double(width) + spacing - c->GetDisplayLeftOffset()) * scaleX - 1;

// Take text scale into account
x += dx * scaleX;
x += dx;
}
}

Expand Down

0 comments on commit d0697d9

Please sign in to comment.