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:
parent
d78338f9ef
commit
f846ba5d59
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue