X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flayouts%2Flayout-engine.cpp;h=bc2a37252439add7121c6d2931c7048bafd495a7;hp=89b6f5b9542d2a99f4751a49b7336331d43c4050;hb=1fcc4ed0e91129dff19b946257bcee49560d9748;hpb=11b00660475d484adc5bcf21583eeaebc5a2f57b diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index 89b6f5b..bc2a372 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 @@ -464,34 +465,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 ) @@ -852,7 +825,7 @@ struct LayoutEngine::Impl Vector newLines; // Estimate the number of lines. - Length linesCapacity = layoutParameters.estimatedNumberOfLines; + Length linesCapacity = std::max( 1u, layoutParameters.estimatedNumberOfLines ); Length numberOfLines = 0u; if( updateCurrentBuffer ) @@ -871,8 +844,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; ) { @@ -1242,11 +1215,13 @@ void LayoutEngine::SetLayout( Layout layout ) LayoutEngine::Layout LayoutEngine::GetLayout() const { + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "GetLayout[%d]\n", mImpl->mLayout); return mImpl->mLayout; } void LayoutEngine::SetTextEllipsisEnabled( bool enabled ) { + DALI_LOG_INFO( gLogFilter, Debug::General, "-->LayoutEngine::SetTextEllipsisEnabled[%s]\n", (enabled)?"true":"false" ); mImpl->mEllipsisEnabled = enabled; }