Fix for the layout engine. 44/43444/1
authorVictor Cebollada <v.cebollada@samsung.com>
Thu, 9 Jul 2015 09:35:07 +0000 (10:35 +0100)
committerVictor Cebollada <v.cebollada@samsung.com>
Thu, 9 Jul 2015 09:37:06 +0000 (10:37 +0100)
* It was not updating the line height for the last character.

Change-Id: Ica8b0c2c3870bb24ebbdc2e3197c3ee551b80876
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
dali-toolkit/internal/text/layouts/layout-engine.cpp

index e75009d..01a5786 100644 (file)
@@ -229,6 +229,14 @@ struct LayoutEngine::Impl
       // Get the glyph info.
       const GlyphInfo& glyphInfo = *( parameters.glyphsBuffer + glyphIndex );
 
       // Get the glyph info.
       const GlyphInfo& glyphInfo = *( parameters.glyphsBuffer + glyphIndex );
 
+      // Check if the font of the current glyph is the same of the previous one.
+      // If it's different the ascender and descender need to be updated.
+      if( lastFontId != glyphInfo.fontId )
+      {
+        UpdateLineHeight( glyphInfo.fontId, tmpLineLayout );
+        lastFontId = glyphInfo.fontId;
+      }
+
       // Get the character indices for the current glyph. The last character index is needed
       // because there are glyphs formed by more than one character but their break info is
       // given only for the last character.
       // Get the character indices for the current glyph. The last character index is needed
       // because there are glyphs formed by more than one character but their break info is
       // given only for the last character.
@@ -421,14 +429,6 @@ struct LayoutEngine::Impl
         tmpLineLayout.Clear();
       }
 
         tmpLineLayout.Clear();
       }
 
-      // Check if the font of the current glyph is the same of the previous one.
-      // If it's different the ascender and descender need to be updated.
-      if( lastFontId != glyphInfo.fontId )
-      {
-        UpdateLineHeight( glyphInfo.fontId, tmpLineLayout );
-        lastFontId = glyphInfo.fontId;
-      }
-
       previousCharacterDirection = characterDirection;
     }
 
       previousCharacterDirection = characterDirection;
     }