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=061707a7bffd434c422e2877b4a8a0b262d78b7f;hp=4ace75b8d90b25afe728548ab59983d96853d6a7;hb=9346cf33ef49063185d54fbbfc186864d96c51ca;hpb=1143e3d6b82789fae32f897d3a416b32fdbf0ef3;ds=sidebyside diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index 4ace75b..061707a 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -394,11 +394,19 @@ struct Engine::Impl tmpLineLayout.wsLengthEndOfLine = 0.f; } + // If calculation is end but wsLengthEndOfLine is exist, it means end of text is space. + // Merge remained length. + if ( !parameters.ignoreSpaceAfterText && glyphIndex == lastGlyphOfParagraphPlusOne-1 && tmpLineLayout.wsLengthEndOfLine > 0 ) + { + tmpLineLayout.length += tmpLineLayout.wsLengthEndOfLine; + tmpLineLayout.wsLengthEndOfLine = 0u; + } + // Save the current extra width to compare with the next one mPreviousCharacterExtraWidth = tmpExtraWidth; // Check if the accumulated length fits in the width of the box. - if( ( completelyFill || isMultiline ) && !isWhiteSpace && + if( ( completelyFill || isMultiline ) && !(parameters.ignoreSpaceAfterText && isWhiteSpace) && ( tmpExtraBearing + lineLayout.length + lineLayout.wsLengthEndOfLine + tmpLineLayout.length + tmpExtraWidth > parameters.boundingBox.width ) ) { // Current word does not fit in the box's width.