Skip to content

Commit

Permalink
- fix status bar scaling: use a fractional that takes full advantage …
Browse files Browse the repository at this point in the history
…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 e7bad72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/g_statusbar/shared_sbar.cpp
Expand Up @@ -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;
Expand Down

2 comments on commit e7bad72

@alexey-lysiuk
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(4 / 3) is 1.

@madame-rachelle
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.