void GetCursorPosition( GetCursorPositionParameters& parameters,
CursorInfo& cursorInfo )
{
+ const LineRun* const modelLines = parameters.visualModel->mLines.Begin();
+ if( NULL == modelLines )
+ {
+ // Nothing to do.
+ return;
+ }
+
// Whether the logical cursor position is at the end of the whole text.
const bool isLastPosition = parameters.logicalModel->mText.Count() == parameters.logical;
// Whether the cursor is in the last position and the last position is a new paragraph character.
const bool isLastNewParagraph = parameters.isMultiline && isLastPosition && TextAbstraction::IsNewParagraph( *( parameters.logicalModel->mText.Begin() + characterOfLine ) );
- const LineRun* const modelLines = parameters.visualModel->mLines.Begin();
-
const LineIndex lineIndex = parameters.visualModel->GetLineOfCharacter( characterOfLine );
const LineRun& line = *( modelLines + lineIndex );
// Set the primary cursor's height.
cursorInfo.primaryCursorHeight = cursorInfo.isSecondaryCursor ? 0.5f * glyphMetrics.fontHeight : glyphMetrics.fontHeight;
-
cursorInfo.glyphOffset = line.ascender - glyphMetrics.ascender;
// Set the primary cursor's position.
cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + primaryPosition.x + glyphAdvance;
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "new size (previous size %f,%f)\n", mImpl->mModel->mVisualModel->mControlSize.width, mImpl->mModel->mVisualModel->mControlSize.height );
+ if( ( 0 == mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd ) &&
+ ( 0 == mImpl->mTextUpdateInfo.mPreviousNumberOfCharacters ) &&
+ ( ( mImpl->mModel->mVisualModel->mControlSize.width < Math::MACHINE_EPSILON_1000 ) || ( mImpl->mModel->mVisualModel->mControlSize.height < Math::MACHINE_EPSILON_1000 ) ) )
+ {
+ mImpl->mTextUpdateInfo.mNumberOfCharactersToAdd = mImpl->mModel->mLogicalModel->mText.Count();
+ }
+
// Layout operations that need to be done if the size changes.
mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending |
LAYOUT |