summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2016-03-23 11:53:53 +0200
committerDaniel Hirt <daniel.hirt@samsung.com>2016-03-23 15:31:20 +0200
commit4013dccda6485312477c247cd23a01a4a0307d76 (patch)
tree4d4b6038bdb8dffc1be45abb55c34a9579012e86 /src/lib/evas/common
parent7e411ecf76a6a73fe37968cce99679c13990c234 (diff)
Evas font: fix width calc in last_up_to_pos
Width calculations should consider the x_bear. This has been leading to inconsistent results between wrapping calculation during layout and the final formatted size. Also, we should stop our walk only when exceeding 'x', so changed "<=" to "<". @fix
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_font_query.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/evas/common/evas_font_query.c b/src/lib/evas/common/evas_font_query.c
index 1c219ee..f435b9b 100644
--- a/src/lib/evas/common/evas_font_query.c
+++ b/src/lib/evas/common/evas_font_query.c
@@ -823,7 +823,7 @@ evas_common_font_query_last_up_to_pos(RGBA_Font *fn, const Evas_Text_Props *text
823 if ((x >= pen_x) && 823 if ((x >= pen_x) &&
824 (((i == 0) && (x <= full_adv)) || 824 (((i == 0) && (x <= full_adv)) ||
825 (x < (full_adv - (gli[-1].pen_after - start_pen)) || 825 (x < (full_adv - (gli[-1].pen_after - start_pen)) ||
826 (x <= (pen_x + gli->width)))) && 826 (x < (pen_x + gli->x_bear + gli->width)))) &&
827 (y >= -asc) && (y <= desc)) 827 (y >= -asc) && (y <= desc))
828 { 828 {
829#ifdef OT_SUPPORT 829#ifdef OT_SUPPORT
@@ -850,8 +850,9 @@ evas_common_font_query_last_up_to_pos(RGBA_Font *fn, const Evas_Text_Props *text
850 850
851 if ((x >= EVAS_FONT_WALK_PEN_X) && 851 if ((x >= EVAS_FONT_WALK_PEN_X) &&
852 ((x < (EVAS_FONT_WALK_PEN_X_AFTER)) || 852 ((x < (EVAS_FONT_WALK_PEN_X_AFTER)) ||
853 (x <= (EVAS_FONT_WALK_PEN_X + _glyph_itr->width))) && 853 (x < (EVAS_FONT_WALK_PEN_X +
854 (y >= -asc) && (y <= desc)) 854 _glyph_itr->x_bear + _glyph_itr->width))) &&
855 (y >= -asc) && (y <= desc))
855 { 856 {
856 ret = EVAS_FONT_WALK_POS; 857 ret = EVAS_FONT_WALK_POS;
857 goto end; 858 goto end;