From 6599e9e422766947f932e4e77dd4ff1de040209d Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Thu, 9 Jul 2015 10:35:07 +0100 Subject: [PATCH 1/1] Fix for the layout engine. * It was not updating the line height for the last character. Change-Id: Ica8b0c2c3870bb24ebbdc2e3197c3ee551b80876 Signed-off-by: Victor Cebollada --- dali-toolkit/internal/text/layouts/layout-engine.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index e75009d..01a5786 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -229,6 +229,14 @@ struct LayoutEngine::Impl // 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. @@ -421,14 +429,6 @@ struct LayoutEngine::Impl 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; } -- 2.7.4