1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 01:29:43 +01:00

Inverse centered text screen border for RTL

If text is set to be centered, but is so long that it starts running
offscreen on both sides, the print function instead makes the text
start no further left than the left border of the screen (x=0).
This is because text running offscreen at the end only is more readable
and looks less sloppy than running offscreen at both sides.

For RTL, the opposite applies, so it now also works oppositely for RTL
prints, where centered strings will only run offscreen on the left side
of the screen.
This commit is contained in:
Dav999 2024-01-08 04:59:08 +01:00 committed by Misa Elizabeth Kai
parent d78338f9ef
commit f846ba5d59

View file

@ -1290,7 +1290,16 @@ void print(
{
x = SCREEN_WIDTH_PIXELS / 2;
}
x = SDL_max(x - textlen/2, 0);
x -= textlen/2;
if (!pf.rtl)
{
x = SDL_max(x, 0);
}
else
{
x = SDL_min(x, SCREEN_WIDTH_PIXELS - textlen);
}
}
else
{