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
Text Alignment Enums now public
[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
17e9f58
..
704c9ed
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.
@@
-1077,7
+1078,7
@@
struct Engine::Impl
void Align( const Size& size,
CharacterIndex startIndex,
Length numberOfCharacters,
void Align( const Size& size,
CharacterIndex startIndex,
Length numberOfCharacters,
-
HorizontalAlignment
horizontalAlignment,
+
Text::HorizontalAlignment::Type
horizontalAlignment,
Vector<LineRun>& lines,
float& alignmentOffset )
{
Vector<LineRun>& lines,
float& alignmentOffset )
{
@@
-1115,32
+1116,32
@@
struct Engine::Impl
}
void CalculateHorizontalAlignment( float boxWidth,
}
void CalculateHorizontalAlignment( float boxWidth,
- HorizontalAlignment horizontalAlignment,
+ HorizontalAlignment
::Type
horizontalAlignment,
LineRun& line )
{
line.alignmentOffset = 0.f;
const bool isRTL = RTL == line.direction;
float lineLength = line.width;
LineRun& line )
{
line.alignmentOffset = 0.f;
const bool isRTL = RTL == line.direction;
float lineLength = line.width;
- HorizontalAlignment alignment = horizontalAlignment;
+ HorizontalAlignment
::Type
alignment = horizontalAlignment;
if( isRTL )
{
// Swap the alignment type if the line is right to left.
switch( alignment )
{
if( isRTL )
{
// Swap the alignment type if the line is right to left.
switch( alignment )
{
- case H
ORIZONTAL_ALIGN_
BEGIN:
+ case H
orizontalAlignment::
BEGIN:
{
{
- alignment = H
ORIZONTAL_ALIGN_
END;
+ alignment = H
orizontalAlignment::
END;
break;
}
break;
}
- case H
ORIZONTAL_ALIGN_
CENTER:
+ case H
orizontalAlignment::
CENTER:
{
// Nothing to do.
break;
}
{
// Nothing to do.
break;
}
- case H
ORIZONTAL_ALIGN_
END:
+ case H
orizontalAlignment::
END:
{
{
- alignment = H
ORIZONTAL_ALIGN_
BEGIN;
+ alignment = H
orizontalAlignment::
BEGIN;
break;
}
}
break;
}
}
@@
-1149,7
+1150,7
@@
struct Engine::Impl
// Calculate the horizontal line offset.
switch( alignment )
{
// Calculate the horizontal line offset.
switch( alignment )
{
- case H
ORIZONTAL_ALIGN_
BEGIN:
+ case H
orizontalAlignment::
BEGIN:
{
line.alignmentOffset = 0.f;
{
line.alignmentOffset = 0.f;
@@
-1160,7
+1161,7
@@
struct Engine::Impl
}
break;
}
}
break;
}
- case H
ORIZONTAL_ALIGN_
CENTER:
+ case H
orizontalAlignment::
CENTER:
{
line.alignmentOffset = 0.5f * ( boxWidth - lineLength );
{
line.alignmentOffset = 0.5f * ( boxWidth - lineLength );
@@
-1172,7
+1173,7
@@
struct Engine::Impl
line.alignmentOffset = floorf( line.alignmentOffset ); // try to avoid pixel alignment.
break;
}
line.alignmentOffset = floorf( line.alignmentOffset ); // try to avoid pixel alignment.
break;
}
- case H
ORIZONTAL_ALIGN_
END:
+ case H
orizontalAlignment::
END:
{
if( isRTL )
{
{
if( isRTL )
{
@@
-1271,7
+1272,7
@@
void Engine::ReLayoutRightToLeftLines( const Parameters& layoutParameters,
void Engine::Align( const Size& size,
CharacterIndex startIndex,
Length numberOfCharacters,
void Engine::Align( const Size& size,
CharacterIndex startIndex,
Length numberOfCharacters,
-
Layout::HorizontalAlignment
horizontalAlignment,
+
Text::HorizontalAlignment::Type
horizontalAlignment,
Vector<LineRun>& lines,
float& alignmentOffset )
{
Vector<LineRun>& lines,
float& alignmentOffset )
{