@@ -461,17 +461,23 @@ namespace RTE {
461
461
AllegroBitmap playerGUIBitmap (drawScreen);
462
462
GUIFont *font = m_IsSmall ? g_FrameMan.GetSmallFont () : g_FrameMan.GetLargeFont ();
463
463
Matrix rotation = Matrix (m_RotAngle);
464
+ Vector targetPosAdjustment = Vector ();
464
465
465
466
BITMAP *tempDrawBitmap = nullptr ;
466
467
if (m_BlendMode > DrawBlendMode::NoBlend || m_RotAngle != 0 ) {
467
- tempDrawBitmap = create_bitmap_ex (8 , font->CalculateWidth (m_Text), font->CalculateHeight (m_Text));
468
+ int textWidth = font->CalculateWidth (m_Text);
469
+ int textHeight = font->CalculateHeight (m_Text);
470
+
471
+ tempDrawBitmap = create_bitmap_ex (8 , textWidth * 2 , textHeight);
468
472
clear_to_color (tempDrawBitmap, ColorKeys::g_MaskColor);
469
473
AllegroBitmap tempDrawAllegroBitmap (tempDrawBitmap);
470
- font->DrawAligned (&tempDrawAllegroBitmap, 0 , 0 , m_Text, m_Alignment);
474
+ font->DrawAligned (&tempDrawAllegroBitmap, textWidth, 0 , m_Text, m_Alignment);
475
+
476
+ targetPosAdjustment = Vector (static_cast <float >(textWidth), 0 );
471
477
}
472
478
473
479
if (!g_SceneMan.SceneWrapsX () && !g_SceneMan.SceneWrapsY ()) {
474
- Vector drawStart = m_StartPos - targetPos;
480
+ Vector drawStart = m_StartPos - targetPos - targetPosAdjustment ;
475
481
476
482
if (m_BlendMode > DrawBlendMode::NoBlend) {
477
483
if (m_RotAngle != 0 ) {
@@ -490,7 +496,7 @@ namespace RTE {
490
496
Vector drawStartLeft;
491
497
Vector drawStartRight;
492
498
493
- TranslateCoordinates (targetPos, m_StartPos, drawStartLeft, drawStartRight);
499
+ TranslateCoordinates (targetPos - targetPosAdjustment , m_StartPos, drawStartLeft, drawStartRight);
494
500
495
501
if (m_BlendMode > DrawBlendMode::NoBlend) {
496
502
if (m_RotAngle != 0 ) {
0 commit comments