namespace
{
const float MAX_FLOAT = std::numeric_limits<float>::max();
+const std::string EMPTY_STRING;
} // namespace
namespace Dali
GetClosestCursorPosition( xPosition, yPosition, height );
mDecorator->SetPosition( PRIMARY_CURSOR, xPosition, yPosition, height );
+ mDecorator->HidePopup();
mDecoratorUpdated = true;
}
+ else if ( GRAB_HANDLE_RELEASED == state )
+ {
+ mDecorator->ShowPopup();
+ }
+
}
void ChangeState( State newState )
mDecorator->StopCursorBlink();
mDecorator->SetGrabHandleActive( false );
mDecorator->SetSelectionActive( false );
+ mDecorator->HidePopup();
mDecoratorUpdated = true;
}
else if ( SELECTING == mState )
return mImpl->mFontDefaults->mDefaultFontFamily;
}
- return Dali::String::EMPTY;
+ return EMPTY_STRING;
}
void Controller::SetDefaultFontStyle( const std::string& defaultFontStyle )
return mImpl->mFontDefaults->mDefaultFontStyle;
}
- return Dali::String::EMPTY;
+ return EMPTY_STRING;
}
void Controller::SetDefaultPointSize( float pointSize )
LAYOUT |
UPDATE_ACTUAL_SIZE |
UPDATE_POSITIONS |
+ UPDATE_LINES |
REORDER );
mImpl->mControlSize = size;
if( LAYOUT & operations )
{
+ const Length numberOfCharacters = mImpl->mLogicalModel->GetNumberOfCharacters();
+
if( 0u == numberOfGlyphs )
{
- const Length numberOfCharacters = mImpl->mLogicalModel->GetNumberOfCharacters();
numberOfGlyphs = mImpl->mVisualModel->GetNumberOfGlyphs();
lineBreakInfo.Resize( numberOfCharacters );
Vector<Vector2> glyphPositions;
glyphPositions.Resize( numberOfGlyphs );
- // Update the visual model
+ // The laid-out lines.
+ // It's not possible to know in how many lines the text is going to be laid-out,
+ // but it can be resized at least with the number of 'paragraphs' to avoid
+ // some re-allocations.
+ Vector<LineRun> lines;
+ lines.Reserve( mImpl->mLogicalModel->GetNumberOfBidirectionalInfoRuns( 0u, numberOfCharacters ) );
+
+ // Update the visual model.
viewUpdated = mImpl->mLayoutEngine.LayoutText( layoutParameters,
glyphPositions,
+ lines,
layoutSize );
- // Sets the positions into the model.
- if( UPDATE_POSITIONS & operations )
+ if( viewUpdated )
{
- mImpl->mVisualModel->SetGlyphPositions( glyphPositions.Begin(),
- numberOfGlyphs );
- }
+ // Sets the positions into the model.
+ if( UPDATE_POSITIONS & operations )
+ {
+ mImpl->mVisualModel->SetGlyphPositions( glyphPositions.Begin(),
+ numberOfGlyphs );
+ }
- // Sets the actual size.
- if( UPDATE_ACTUAL_SIZE & operations )
- {
- mImpl->mVisualModel->SetActualSize( layoutSize );
+ // Sets the lines into the model.
+ if( UPDATE_LINES & operations )
+ {
+ mImpl->mVisualModel->SetLines( lines.Begin(),
+ lines.Count() );
+ }
+
+ // Sets the actual size.
+ if( UPDATE_ACTUAL_SIZE & operations )
+ {
+ mImpl->mVisualModel->SetActualSize( layoutSize );
+ }
}
}
else