fix wrong cursor position in TextField 25/254125/1
authorBowon Ryu <bowon.ryu@samsung.com>
Tue, 23 Feb 2021 07:01:06 +0000 (16:01 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Tue, 23 Feb 2021 07:46:35 +0000 (16:46 +0900)
commitc4f615acb91de4d6809319fb72700d22298b81c8
tree7f5833f3d094b0edc70d00afe307704453478486
parent8112af2d369becef537a1decac926550675f71ef
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: I031635bb8c5ed790700d89de4b046515bff5bf73
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali-toolkit/internal/text/text-controller-relayouter.cpp