Browse Source

Merge pull request #97 from lilligreen/fix/ImageFontSize

Fix ImageFont AABB size with left or right text alignment
Simon Love 12 years ago
parent
commit
34f5ff85eb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      engine/source/2d/sceneobject/ImageFont.cc

+ 2 - 2
engine/source/2d/sceneobject/ImageFont.cc

@@ -366,14 +366,14 @@ void ImageFont::calculateSpatials( void )
         case ALIGN_LEFT:
         case ALIGN_LEFT:
             {
             {
                 // Size is twice the padded text width as we're aligning to the left from the position expanding rightwards.
                 // Size is twice the padded text width as we're aligning to the left from the position expanding rightwards.
-                setSize( totalPaddedTextSize * 2.0f );
+                setSize( totalPaddedTextSize.x * 2.0f, totalPaddedTextSize.y );
             }
             }
             break;
             break;
 
 
         case ALIGN_RIGHT:
         case ALIGN_RIGHT:
             {
             {
                 // Size is twice the padded text width as we're aligning to the right from the position expanding leftwards.
                 // Size is twice the padded text width as we're aligning to the right from the position expanding leftwards.
-                setSize( totalPaddedTextSize * 2.0f );
+                setSize( totalPaddedTextSize.x * 2.0f, totalPaddedTextSize.y );
             }
             }
             break;
             break;