- added protection against oversized menu caption bars.

SWC20 is a mod that contains a caption that is larger then the entire screen and was pushing the actual menu content out of it.
Fixes #239
This commit is contained in:
Christoph Oelckers 2021-02-02 23:49:04 +01:00
parent 8e0c50c22c
commit 20db6b0c78
3 changed files with 3 additions and 3 deletions

View file

@ -26,7 +26,7 @@ class BloodMenuDelegate : RazeMenuDelegate
} }
double fx, fy, fw, fh; double fx, fy, fw, fh;
[fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top); [fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top);
int h = texid.isValid()? texsize.Y : fonth; int h = texid.isValid() && texsize.Y < 40? texsize.Y : fonth;
return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels. return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels.
} }

View file

@ -21,7 +21,7 @@ class DukeMenuDelegate : RazeMenuDelegate
} }
double fx, fy, fw, fh; double fx, fy, fw, fh;
[fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top); [fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top);
int h = texid.isValid()? texsize.Y : fonth; int h = texid.isValid() && texsize.Y < 40? texsize.Y : fonth;
return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels. return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels.
} }

View file

@ -33,7 +33,7 @@ class SWMenuDelegate : RazeMenuDelegate
} }
double fx, fy, fw, fh; double fx, fy, fw, fh;
[fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top); [fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top);
int h = texid.isValid()? texsize.Y : fonth; int h = texid.isValid() && texsize.Y < 40? texsize.Y : fonth;
return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels. return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels.
} }