/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
else
{
- lineLayout.length = length;
+ lineLayout.length = std::max( length, lineLayout.length );
}
}
}
tmpLineLayout.penX += tmpLineLayout.previousAdvance + tmpLineLayout.whiteSpaceLengthEndOfLine;
tmpLineLayout.previousAdvance = ( glyphMetrics.advance + parameters.interGlyphExtraAdvance );
- tmpLineLayout.length = tmpLineLayout.penX + glyphMetrics.xBearing + glyphMetrics.width;
+ tmpLineLayout.length = std::max( tmpLineLayout.length, tmpLineLayout.penX + glyphMetrics.xBearing + glyphMetrics.width );
// Clear the white space length at the end of the line.
tmpLineLayout.whiteSpaceLengthEndOfLine = 0.f;
// Convert the character in the visual order into the glyph in the visual order.
const GlyphIndex glyphIndex = *( charactersToGlyphsBuffer + characterVisualIndex ) + index;
- DALI_ASSERT_DEBUG( 0u <= glyphIndex && glyphIndex < layoutParameters.textModel->mVisualModel->mGlyphs.Count() );
+ DALI_ASSERT_DEBUG( glyphIndex < layoutParameters.textModel->mVisualModel->mGlyphs.Count() );
const GlyphInfo& glyph = *( glyphsBuffer + glyphIndex );
Vector2& position = *( glyphPositionsBuffer + glyphIndex - layoutParameters.startGlyphIndex );
lineRun.characterRun.numberOfCharacters = layout.numberOfCharacters;
lineRun.lineSpacing = mDefaultLineSpacing;
- if( isLastLine && !layoutParameters.isLastNewParagraph )
- {
- lineRun.width = layout.length;
- if( LTR == layout.direction )
- {
- lineRun.width += layout.whiteSpaceLengthEndOfLine;
- lineRun.extraLength = 0.f;
- }
- else
- {
- lineRun.extraLength = layout.whiteSpaceLengthEndOfLine;
- }
- }
- else
- {
- lineRun.width = layout.length;
- lineRun.extraLength = std::ceil( layout.whiteSpaceLengthEndOfLine );
- }
+ lineRun.width = layout.length;
+ lineRun.extraLength = std::ceil( layout.whiteSpaceLengthEndOfLine );
+
// Rounds upward to avoid a non integer size.
lineRun.width = std::ceil( lineRun.width );