In OnRelayout, the size of mStencil, mActiveLayer should be calculated including padding.
And the elements of text-decorator should also be positioned based on the size including padding.
Change-Id: Iafc745a464b39560bb9707675878d3b47944653b
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
return mController->GetHeightForWidth(width) + padding.top + padding.bottom;
}
+void TextEditor::ResizeActor(Actor& actor, const Vector2& size)
+{
+ if (actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+ {
+ actor.SetProperty(Actor::Property::SIZE, size);
+ }
+}
+
void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextEditor OnRelayout\n");
if(mStencil)
{
mStencil.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+ ResizeActor(mStencil, contentSize);
}
if(mActiveLayer)
{
mActiveLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+ ResizeActor(mActiveLayer, contentSize);
}
const Text::Controller::UpdateTextType updateTextType = mController->Relayout(contentSize, layoutDirection);
if(mDecorator &&
(Text::Controller::NONE_UPDATED != (Text::Controller::DECORATOR_UPDATED & updateTextType)))
{
- mDecorator->Relayout(size);
+ mDecorator->Relayout(contentSize);
}
if(!mRenderer)
TextEditor& operator=(const TextEditor& rhs);
/**
+ * @brief Resize actor to the given size.
+ *
+ * @param[in] actor The actor to be resized.
+ * @param[in] size Size to change.
+ */
+ void ResizeActor( Actor& actor, const Vector2& size );
+
+ /**
* @brief Render view, create and attach actor(s) to this text editor.
*/
void RenderText(Text::Controller::UpdateTextType updateTextType);
return mController->GetHeightForWidth(width) + padding.top + padding.bottom;
}
+void TextField::ResizeActor(Actor& actor, const Vector2& size)
+{
+ if (actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+ {
+ actor.SetProperty(Actor::Property::SIZE, size);
+ }
+}
+
void TextField::OnRelayout(const Vector2& size, RelayoutContainer& container)
{
DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextField OnRelayout\n");
if(mStencil)
{
mStencil.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+ ResizeActor(mStencil, contentSize);
}
if(mActiveLayer)
{
mActiveLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+ ResizeActor(mActiveLayer, contentSize);
}
const Text::Controller::UpdateTextType updateTextType = mController->Relayout(contentSize, layoutDirection);
if(mDecorator &&
(Text::Controller::NONE_UPDATED != (Text::Controller::DECORATOR_UPDATED & updateTextType)))
{
- mDecorator->Relayout(size);
+ mDecorator->Relayout(contentSize);
}
if(!mRenderer)
TextField& operator=(const TextField& rhs);
/**
+ * @brief Resize actor to the given size.
+ *
+ * @param[in] actor The actor to be resized.
+ * @param[in] size Size to change.
+ */
+ void ResizeActor( Actor& actor, const Vector2& size );
+
+ /**
* @brief Render view, create and attach actor(s) to this Text Field.
*/
void RenderText(Text::Controller::UpdateTextType updateTextType);