cursorInfo.lineHeight = GetDefaultFontLineHeight();
cursorInfo.primaryCursorHeight = cursorInfo.lineHeight;
- switch( mModel->mHorizontalAlignment )
+ bool isRTL = false;
+ HorizontalAlignment::Type alignment = mModel->mHorizontalAlignment;
+ if( mModel->mMatchSystemLanguageDirection )
+ {
+ isRTL = mLayoutDirection == LayoutDirection::RIGHT_TO_LEFT;
+ }
+ // Swap the alignment type if the line is right to left.
+ if( isRTL )
+ {
+ switch( alignment )
+ {
+ case HorizontalAlignment::BEGIN:
+ {
+ alignment = HorizontalAlignment::END;
+ break;
+ }
+ case HorizontalAlignment::CENTER:
+ {
+ // Nothing to do.
+ break;
+ }
+ case HorizontalAlignment::END:
+ {
+ alignment = HorizontalAlignment::BEGIN;
+ break;
+ }
+ }
+ }
+
+
+ switch( alignment )
{
case Text::HorizontalAlignment::BEGIN :
{