There is a problem that ellipsis does not work properly when MIN_LINE_SIZE is set.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / layouts / layout-engine.cpp
index fb63d96..5e5cce7 100755 (executable)
@@ -670,7 +670,7 @@ struct Engine::Impl
       const GlyphInfo& glyph = *( glyphsBuffer + i );
       Vector2& position = *( glyphPositionsBuffer + i );
 
-      position.x = std::roundf( penX + glyph.xBearing );
+      position.x = penX + glyph.xBearing;
       position.y = -glyph.yBearing;
 
       penX += ( glyph.advance + interGlyphExtraAdvance );
@@ -732,7 +732,7 @@ struct Engine::Impl
         const GlyphInfo& glyph = *( glyphsBuffer + glyphIndex );
         Vector2& position = *( glyphPositionsBuffer + glyphIndex - layoutParameters.startGlyphIndex );
 
-        position.x = std::round( penX + glyph.xBearing );
+        position.x = penX + glyph.xBearing;
         position.y = -glyph.yBearing;
 
        penX += ( glyph.advance + layoutParameters.interGlyphExtraAdvance );
@@ -1360,6 +1360,13 @@ struct Engine::Impl
 
         // Updates the vertical pen's position.
         penY += -layout.descender + layout.lineSpacing + mDefaultLineSpacing;
+        // If there is a defaultLineSize, updates the pen's position.
+        if( mDefaultLineSize > 0.f )
+        {
+          float lineSpacing = mDefaultLineSize - ( layout.ascender + -layout.descender );
+          lineSpacing = lineSpacing < 0.f ? 0.f : lineSpacing;
+          penY += lineSpacing;
+        }
 
         // Increase the glyph index.
         index = nextIndex;