X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flayouts%2Flayout-engine.cpp;h=cd51c8d1618daac9cbc02e449cac557ba7f75a14;hb=d00a250741411c386d988e7ac34525cf94a1918e;hp=b992623901b88b8a7581f9f25a3a60351873494c;hpb=39fc99671f79f683a834406e24edf485752c600d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index b992623..cd51c8d 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -25,6 +25,7 @@ // INTERNAL INCLUDES #include +#include #include #include @@ -466,34 +467,6 @@ struct LayoutEngine::Impl DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--GetLineLayoutForBox\n" ); } - /** - * @brief Calculates the vertical offset to add to the new laid-out glyphs. - * - * @pre @p lineIndex must be between 0 and the number of lines (both inclusive). - * - * @param[in] lines The previously laid-out lines. - * @param[in] lineIndex Index to the line where the new laid-out lines are inserted. - * - * @return The vertical offset of the lines starting from the beginning to the line @p lineIndex. - */ - float SetParagraphOffset( const Vector& lines, - LineIndex lineIndex ) - { - float offset = 0.f; - - for( Vector::ConstIterator it = lines.Begin(), - endIt = lines.Begin() + lineIndex; - it != endIt; - ++it ) - { - const LineRun& line = *it; - - offset += line.ascender + -line.descender; - } - - return offset; - } - void SetGlyphPositions( const GlyphInfo* const glyphsBuffer, Length numberOfGlyphs, Vector2* glyphPositionsBuffer ) @@ -822,6 +795,10 @@ struct LayoutEngine::Impl } } + // Calculates the layout size. + UpdateLayoutSize( lines, + layoutSize ); + // Nothing else do if there are no glyphs to layout. return false; } @@ -873,8 +850,8 @@ struct LayoutEngine::Impl linesBuffer = lines.Begin(); } - float penY = SetParagraphOffset( lines, - layoutParameters.startLineIndex ); + float penY = CalculateLineOffset( lines, + layoutParameters.startLineIndex ); for( GlyphIndex index = layoutParameters.startGlyphIndex; index < lastGlyphPlusOne; ) {