- if(info.mIsRightToLeftCharacter && !infoStart.mIsRightToLeftCharacter)
- {
- // For text Starting as LTR and ending as RTL. End cursor position is as follows:
- // Text: [...LTR...]|[...RTL...]
- // Cursor pos: ^
- // Alternate cursor pos: ^
- // In which case we need to display an alternate cursor for the RTL text, this cursor
- // should be at the end of the given line.
-
- const Toolkit::TextView::CharacterLayoutInfo& infoAlt = mTextLayoutInfo.mCharacterLayoutInfoTable[ mTextLayoutInfo.mCharacterLayoutInfoTable.size() - 1 ];
- alternatePosition.x = infoAlt.mPosition.x + infoAlt.mSize.width;
- alternatePosition.y = infoAlt.mPosition.y;
- alternatePositionValid = true;
- }
- else if(!info.mIsRightToLeftCharacter && infoStart.mIsRightToLeftCharacter) // starting RTL
- {
- // For text Starting as RTL and ending as LTR. End cursor position is as follows:
- // Text: |[...RTL...] [...LTR....]
- // Cursor pos: ^
- // Alternate cursor pos: ^
- // In which case we need to display an alternate cursor for the RTL text.
-
- const Toolkit::TextView::CharacterLayoutInfo& infoAlt = mTextLayoutInfo.mCharacterLayoutInfoTable[ startCharacterPosition ];
- alternatePosition.x = infoAlt.mPosition.x;
- alternatePosition.y = infoAlt.mPosition.y;
- alternatePositionValid = true;
+ if(info.mIsRightToLeftCharacter)
+ {
+ // For text Starting as LTR and ending as RTL. End cursor position is as follows:
+ // Text: [...LTR...]|[...RTL...]
+ // Cursor pos: ^
+ // Alternate cursor pos: ^
+ // In which case we need to display an alternate cursor for the RTL text, this cursor
+ // should be at the end of the given line.
+
+ alternatePosition.x = infoStart.mPosition.x + infoStart.mSize.width;
+ alternatePosition.y = infoStart.mPosition.y;
+ alternatePositionValid = true;
+ }
+ else if(!info.mIsRightToLeftCharacter) // starting RTL
+ {
+ // For text Starting as RTL and ending as LTR. End cursor position is as follows:
+ // Text: |[...RTL...] [...LTR....]
+ // Cursor pos: ^
+ // Alternate cursor pos: ^
+ // In which case we need to display an alternate cursor for the RTL text.
+
+ alternatePosition.x = infoStart.mPosition.x;
+ alternatePosition.y = infoStart.mPosition.y;
+ alternatePositionValid = true;
+ }
+ }