1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Improve tooltip position with RTL languages

This commit is contained in:
Mathieu Schroeter 2022-10-22 18:15:22 +02:00
parent c5685dcf00
commit e619f998ac
No known key found for this signature in database
GPG Key ID: 8B9145A5FA9DA8A8

View File

@ -3130,13 +3130,13 @@ CEvent::EventButtons (const SDL_Event & event, Point pos)
snprintf (m_textToolTips, sizeof (m_textToolTips), "%s", text);
lg = GetTextWidth (m_textToolTips);
pos.x += IsRightReading () ? 0 : 10;
pos.y += 20;
pos.y += IsRightReading () ? 16 : 20;
if (pos.x > LXIMAGE () + (IsRightReading () ? 0 : -lg))
pos.x = LXIMAGE () - lg;
if (pos.x < 0)
pos.x = 0;
if (pos.y > LYIMAGE () - 14)
pos.y = LYIMAGE () - 14;
if (pos.y > LYIMAGE () - (GetLocale () == "ar" ? 22 : 16))
pos.y = LYIMAGE () - (GetLocale () == "ar" ? 22 : 16);
m_posToolTips = pos;
break;
}