[Tizen] fix wrong cursor position in TextField 97/254597/1 accepted/tizen/6.0/unified/20210307.214530 submit/tizen_6.0/20210305.052634
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 5 Mar 2021 03:53:44 +0000 (12:53 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Fri, 5 Mar 2021 03:56:53 +0000 (12:56 +0900)
commit0a0b9dc2df798519fa1f8d8bffff9c5c74e967b1
tree9ceb271abde12877d511067d7df65e0be5e07392
parent5e79f29ff3e9a6042eb44dc40130c0d648bc2a3b
[Tizen] fix wrong cursor position in TextField

When the placeholder font size is bigger/smaller than default font size,
the cursor is positioned incorrectly.

this is because mScrollPosition.y is calculated based on layoutSize.height at CalculateVerticalOffset().
(this is not based on cursor height.
in issue situation, layoutSize.height is bigger/smaller than defaultFontLineHeight.)

This patch prevents the wrong positioning of cursor when the layoutSize.height is bigger/smaller than defaultFontLineHeight.
And update the glyphPositions using recalculated offset.

This issue only occurs with placeholder + single line text control. (vertical alignment)

I hope this modification does not affect the calculation of other texts.
So, update the glyphPositions in CalculateVerticalOffset().

Change-Id: I05847bbe5dcce6451c6b24649f80ea945e1ed7ea
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali-toolkit/internal/text/text-controller.cpp