From: Youngbok Shin Date: Fri, 29 Jun 2018 09:31:35 +0000 (+0900) Subject: textpath: reduces differences between actual position and modified position X-Git-Tag: submit/tizen_4.0/20180705.082454 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen_4.0%2F20180705.082454;p=platform%2Fupstream%2Felementary.git textpath: reduces differences between actual position and modified position @tizen_fix Change-Id: Ic6fa6b8e196c25054929e25575b47d4fc953275d --- diff --git a/src/lib/efl_ui_textpath.c b/src/lib/efl_ui_textpath.c index d145a0a..08b3e94 100644 --- a/src/lib/efl_ui_textpath.c +++ b/src/lib/efl_ui_textpath.c @@ -178,7 +178,9 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist, vec2.y = (-vec.y + py); /* Set mp1, mp2 position according to difference between previous points and next points. - * It improves smoothness of curve's slope changing. */ + * It improves smoothness of curve's slope changing. It can show smooth result. + * But, it can cause huge differeces from actual positions. + * */ mp0_x = *last_x1; mp0_y = *last_y1; mp1_x = *last_x1 + (int) floor(vec1.x - vec0.x + 0.5); @@ -188,6 +190,12 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist, mp3_x = *last_x2; mp3_y = *last_y2; + /* It reduces differences between actual position and modified position. */ + mp1_x += (int)floor(((double)vec1.x - mp1_x) / 2 + 0.5); + mp1_y += (int)floor(((double)vec1.y - mp1_y) / 2 + 0.5); + mp2_x += (int)floor(((double)vec2.x - mp2_x) / 2 + 0.5); + mp2_y += (int)floor(((double)vec2.y - mp2_y) / 2 + 0.5); + evas_map_point_coord_set(map, cmp + i * 4, mp0_x, mp0_y, 0); evas_map_point_coord_set(map, cmp + i * 4 + 1, mp1_x, mp1_y, 0); evas_map_point_coord_set(map, cmp + i * 4 + 2, mp2_x, mp2_y, 0);