// Creates an extra control to be used as stencil buffer.
mStencil = Control::New();
- mStencil.SetAnchorPoint( AnchorPoint::CENTER );
- mStencil.SetParentOrigin( ParentOrigin::CENTER );
+ mStencil.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mStencil.SetParentOrigin( ParentOrigin::TOP_LEFT );
// Creates a background visual. Even if the color is transparent it updates the stencil.
mStencil.SetProperty( Toolkit::Control::Property::BACKGROUND,
float TextEditor::GetHeightForWidth( float width )
{
- return mController->GetHeightForWidth( width );
+ Padding padding;
+ Self().GetPadding( padding );
+ return mController->GetHeightForWidth( width ) + padding.top + padding.bottom;
}
void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor OnRelayout\n");
- const Text::Controller::UpdateTextType updateTextType = mController->Relayout( size );
+ Actor self = Self();
+ Padding padding;
+
+ self.GetPadding( padding );
+ Vector2 contentSize( size.x - ( padding.left + padding.right ), size.y - ( padding.top + padding.bottom ) );
+
+ if( mStencil )
+ {
+ mStencil.SetPosition( padding.left , padding.top );
+ }
+ if( mActiveLayer )
+ {
+ mActiveLayer.SetPosition( padding.left , padding.top );
+ }
+
+
+ const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize );
if( ( Text::Controller::NONE_UPDATED != updateTextType ) ||
!mRenderer )
}
RenderText( updateTextType );
+
}
// The text-editor emits signals when the input style changes. These changes of style are
mImfManager.Activate();
// Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
- mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x, gesture.localPoint.y );
+ Padding padding;
+ Self().GetPadding( padding );
+ mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
SetKeyInputFocus();
}
{
mImfManager.Activate();
- mController->LongPressEvent( gesture.state, gesture.localPoint.x, gesture.localPoint.y );
+ Padding padding;
+ Self().GetPadding( padding );
+ mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.left, gesture.localPoint.y - padding.top );
SetKeyInputFocus();
}
}
else
{
+ actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
Self().Add( actor );
+ mActiveLayer = actor;
}
}
}
return;
}
- // If scrolling is not started, start scrolling and emit ScrollStateChangedSignal
- if( !mScrollStarted )
- {
- mScrollStarted = true;
- Dali::Toolkit::TextEditor handle( GetOwner() );
- mScrollStateChangedSignal.Emit( handle, DevelTextEditor::Scroll::STARTED );
- }
-
CustomActor self = Self();
if( !mScrollBar )
{
self.SetProperty( propertyScrollContentSize, layoutSize );
}
+ // If scrolling is not started, start scrolling and emit ScrollStateChangedSignal
+ if( !mScrollStarted )
+ {
+ mScrollStarted = true;
+ Dali::Toolkit::TextEditor handle( GetOwner() );
+ mScrollStateChangedSignal.Emit( handle, DevelTextEditor::Scroll::STARTED );
+ }
+
Actor indicator = mScrollBar.GetScrollIndicator();
if( mAnimation )
{