Skip to content
Permalink
Browse files

- fix status bar scaling: use a fractional that takes full advantage …

…of the precision type, rather than a static numerical constant. (this fixes rendering in very odd resolutions such as 1440x847)
  • Loading branch information
madame-rachelle committed Mar 22, 2020
1 parent aa0df74 commit e7bad7218f514334a851a6db19c7e83e027b8299
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/g_statusbar/shared_sbar.cpp
@@ -478,15 +478,15 @@ void DBaseStatusBar::SetScale ()
{
// Wider or equal than 4:3
SBarTop = Scale(sby, h, VerticalResolution);
double width4_3 = w * 1.333 / aspect;
double width4_3 = w * (4 / 3) / aspect;
ST_X = int((w - width4_3) / 2);
}
else
{ // 5:4 resolution
ST_X = 0;

// this was far more obtuse before...
double height4_3 = h * aspect / 1.333;
double height4_3 = h * aspect / (4 / 3);
SBarTop = int(h - height4_3 + sby * height4_3 / VerticalResolution);
}
Displacement = 0;

2 comments on commit e7bad72

@alexey-lysiuk

This comment has been minimized.

Copy link
Collaborator

@alexey-lysiuk alexey-lysiuk replied Mar 22, 2020

(4 / 3) is 1.

@madame-rachelle

This comment has been minimized.

Copy link
Collaborator Author

@madame-rachelle madame-rachelle replied Mar 22, 2020

Whoops. You're right. Setting it to (4. / 3.) brings back the buggy behavior...

Please sign in to comment.
You can’t perform that action at this time.