projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Note that some Text propeties in devel api can't be changed" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
layouts
/
layout-engine.cpp
diff --git
a/dali-toolkit/internal/text/layouts/layout-engine.cpp
b/dali-toolkit/internal/text/layouts/layout-engine.cpp
index
148ff58
..
12f20e4
100644
(file)
--- a/
dali-toolkit/internal/text/layouts/layout-engine.cpp
+++ b/
dali-toolkit/internal/text/layouts/layout-engine.cpp
@@
-198,6
+198,7
@@
struct Engine::Impl
LineLayout tmpLineLayout;
const bool isMultiline = mLayout == MULTI_LINE_BOX;
LineLayout tmpLineLayout;
const bool isMultiline = mLayout == MULTI_LINE_BOX;
+ const bool isWordLaidOut = parameters.lineWrapMode == Layout::LineWrap::WORD;
// The last glyph to be laid-out.
const GlyphIndex lastGlyphOfParagraphPlusOne = parameters.startGlyphIndex + parameters.numberOfGlyphs;
// The last glyph to be laid-out.
const GlyphIndex lastGlyphOfParagraphPlusOne = parameters.startGlyphIndex + parameters.numberOfGlyphs;
@@
-447,7
+448,7
@@
struct Engine::Impl
if( isMultiline &&
( TextAbstraction::WORD_BREAK == wordBreakInfo ) )
{
if( isMultiline &&
( TextAbstraction::WORD_BREAK == wordBreakInfo ) )
{
- oneWordLaidOut =
true
;
+ oneWordLaidOut =
isWordLaidOut
;
DALI_LOG_INFO( gLogFilter, Debug::Verbose, " One word laid-out\n" );
// Current glyph is the last one of the current word.
DALI_LOG_INFO( gLogFilter, Debug::Verbose, " One word laid-out\n" );
// Current glyph is the last one of the current word.
@@
-1078,10
+1079,12
@@
struct Engine::Impl
CharacterIndex startIndex,
Length numberOfCharacters,
HorizontalAlignment horizontalAlignment,
CharacterIndex startIndex,
Length numberOfCharacters,
HorizontalAlignment horizontalAlignment,
- Vector<LineRun>& lines )
+ Vector<LineRun>& lines,
+ float& alignmentOffset )
{
const CharacterIndex lastCharacterPlusOne = startIndex + numberOfCharacters;
{
const CharacterIndex lastCharacterPlusOne = startIndex + numberOfCharacters;
+ alignmentOffset = MAX_FLOAT;
// Traverse all lines and align the glyphs.
for( Vector<LineRun>::Iterator it = lines.Begin(), endIt = lines.End();
it != endIt;
// Traverse all lines and align the glyphs.
for( Vector<LineRun>::Iterator it = lines.Begin(), endIt = lines.End();
it != endIt;
@@
-1106,6
+1109,9
@@
struct Engine::Impl
CalculateHorizontalAlignment( size.width,
horizontalAlignment,
line );
CalculateHorizontalAlignment( size.width,
horizontalAlignment,
line );
+
+ // Updates the alignment offset.
+ alignmentOffset = std::min( alignmentOffset, line.alignmentOffset );
}
}
}
}
@@
-1267,13
+1273,15
@@
void Engine::Align( const Size& size,
CharacterIndex startIndex,
Length numberOfCharacters,
Layout::HorizontalAlignment horizontalAlignment,
CharacterIndex startIndex,
Length numberOfCharacters,
Layout::HorizontalAlignment horizontalAlignment,
- Vector<LineRun>& lines )
+ Vector<LineRun>& lines,
+ float& alignmentOffset )
{
mImpl->Align( size,
startIndex,
numberOfCharacters,
horizontalAlignment,
{
mImpl->Align( size,
startIndex,
numberOfCharacters,
horizontalAlignment,
- lines );
+ lines,
+ alignmentOffset );
}
void Engine::SetDefaultLineSpacing( float lineSpacing )
}
void Engine::SetDefaultLineSpacing( float lineSpacing )