This patch fixes an issue where the cursor position is incorrectly positioned
when padding is set for the textfield text editor.
It is a problem caused by the wrong location of the cursor layer.
Change-Id: Ifa0e9b752160761dfd6806cfc18dbf98576c71e3
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
}
if(mCursorLayer)
{
- mCursorLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+ // The cursor layer is added to the stencil in RenderText.
+ // Do not calculate the position because the stencil has already been resized excluding the padding size.
+ // There is no case where the text editor does not have a stencil.
ResizeActor(mCursorLayer, contentSize);
}
}
if(mCursorLayer)
{
- mCursorLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+ if(!mStencil)
+ {
+ // If there is a stencil, the cursor layer is added to the stencil in RenderText.
+ // Do not calculate the position because the stencil has already been resized excluding the padding size.
+ mCursorLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+ }
ResizeActor(mCursorLayer, contentSize);
}