// Get the direction of the first character.
const CharacterDirection firstParagraphDirection = mImpl->mLogicalModel->GetCharacterDirection( 0u );
- const Size& actualSize = mImpl->mVisualModel->GetActualSize();
+ Size actualSize = mImpl->mVisualModel->GetActualSize();
+ if( fabsf( actualSize.height ) < Math::MACHINE_EPSILON_1000 )
+ {
+ // Get the line height of the default font.
+ actualSize.height = mImpl->GetDefaultFontLineHeight();
+ }
// If the first paragraph is right to left swap ALIGN_BEGIN and ALIGN_END;
LayoutEngine::HorizontalAlignment horizontalAlignment = mImpl->mLayoutEngine.GetHorizontalAlignment();
mImpl->ChangeState( EventData::INTERRUPTED ); // State is not INACTIVE as expect to return to edit mode.
// Avoids calling the InsertText() method which can delete selected text
}
- else if ( IsKey( keyEvent, Dali::DALI_KEY_MENU ) )
+ else if ( IsKey( keyEvent, Dali::DALI_KEY_MENU ) ||
+ IsKey( keyEvent, Dali::DALI_KEY_HOME ) )
{
mImpl->ChangeState( EventData::INACTIVE );
- // Menu key behaviour does not allow edit to resume like Power key
+ // Menu/Home key behaviour does not allow edit mode to resume like Power key
// Avoids calling the InsertText() method which can delete selected text
}
else
if( !isShowingPlaceholderText &&
( EventData::EDITING == mImpl->mEventData->mState ) )
{
- mImpl->mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
- mImpl->mEventData->mDecorator->SetPopupActive( false );
+ mImpl->ChangeState( EventData::EDITING_WITH_GRAB_HANDLE );
}
-
- // Handles & cursors must be repositioned after Relayout() i.e. after the Model has been updated
- if( mImpl->mEventData )
+ else if( EventData::EDITING_WITH_GRAB_HANDLE != mImpl->mEventData->mState )
{
+ // Handles & cursors must be repositioned after Relayout() i.e. after the Model has been updated
mImpl->ChangeState( EventData::EDITING );
+ }
- Event event( Event::TAP_EVENT );
- event.p1.mUint = tapCount;
- event.p2.mFloat = x;
- event.p3.mFloat = y;
- mImpl->mEventData->mEventQueue.push_back( event );
+ Event event( Event::TAP_EVENT );
+ event.p1.mUint = tapCount;
+ event.p2.mFloat = x;
+ event.p3.mFloat = y;
+ mImpl->mEventData->mEventQueue.push_back( event );
- mImpl->RequestRelayout();
- }
+ mImpl->RequestRelayout();
}
else if( !isShowingPlaceholderText &&
mImpl->mEventData->mSelectionEnabled &&