Fix GetTextBoundingRectangle size issue 70/281370/2
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 16 Sep 2022 05:54:18 +0000 (14:54 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Fri, 16 Sep 2022 08:51:33 +0000 (17:51 +0900)
commitc58c49ba4b68d3e398defe6da67a3f5393cd8ee2
treea2059faa2b2d69af9a158868873ac5a774ddd10f
parentcdf5a545f4fd5e06ca9b511cacd0079e0fd98dd4
Fix GetTextBoundingRectangle size issue

TextGeometry calculates the size and position of the actual text with glyphAdvance.
This means that sometimes the x position will be negative,
or the text's line width may be greater than the control's width.

While this is an accurate value,
it is not suitable for calculating the minimum bounding rect of text.
Because the text appears to be outside the control.

This patch adjusts the return value of GetTextBoundingRectangle()
so that it does not exceed the bounds of the text control.

Change-Id: Ie80ac1a8b5cec5f8c21013744645254381c78fb6
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Text.cpp
dali-toolkit/internal/text/controller/text-controller.cpp