summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2019-02-25 15:26:25 +0900
committerHermet Park <hermetpark@gmail.com>2019-02-25 15:27:00 +0900
commit45b475d9d4ce00d7dd2c2334e2b29d674db2fdc0 (patch)
treeaf572b8e8a0d63a98023c81958cd225b3b14b7b8
parenta2cfa9340a4650eae965a920788c0edd1141cfe4 (diff)
elm textpath: reduces differences between actual pos and modified pos
Summary: In a previous patch, textpath was modified to use differences between prev/next values to decide next position. Actually, it improved rendering quality. But, the modified position could have a big difference from actual position. It caused a distortion problem. So, this patch was made for reducing that differences. @fix Test Plan: I'll attach some screenshots of before/after. 1. Modify text in text_ui_textpath.c to see distortion of text. ex) "―――――――――――――――――――..." 2. Build and install. 3. Run "ELM_SCALE=0.8 ELM_ACCEL=gl elementary_test -to efl.ui.textpath" Reviewers: Hermet, raster, cedric Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7418
-rw-r--r--src/lib/elementary/efl_ui_textpath.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c
index 8d4076ecdc..59b85480bf 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -178,7 +178,8 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist,
178 178
179 /* Set mp1, mp2 position according to difference between 179 /* Set mp1, mp2 position according to difference between
180 * previous points and next points. 180 * previous points and next points.
181 * It improves smoothness of curve's slope changing. */ 181 * It improves smoothness of curve's slope changing.
182 * But, it can cause huge differeces from actual positions. */
182 mp0_x = *last_x1; 183 mp0_x = *last_x1;
183 mp0_y = *last_y1; 184 mp0_y = *last_y1;
184 mp1_x = *last_x1 + (int) round(vec1.x - vec0.x); 185 mp1_x = *last_x1 + (int) round(vec1.x - vec0.x);
@@ -188,6 +189,12 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist,
188 mp3_x = *last_x2; 189 mp3_x = *last_x2;
189 mp3_y = *last_y2; 190 mp3_y = *last_y2;
190 191
192 /* It reduces differences between actual position and modified position. */
193 mp1_x += (int)round(((double)vec1.x - mp1_x) / 2);
194 mp1_y += (int)round(((double)vec1.y - mp1_y) / 2);
195 mp2_x += (int)round(((double)vec2.x - mp2_x) / 2);
196 mp2_y += (int)round(((double)vec2.y - mp2_y) / 2);
197
191 evas_map_point_coord_set(map, cmp + i * 4, mp0_x, mp0_y, 0); 198 evas_map_point_coord_set(map, cmp + i * 4, mp0_x, mp0_y, 0);
192 evas_map_point_coord_set(map, cmp + i * 4 + 1, mp1_x, mp1_y, 0); 199 evas_map_point_coord_set(map, cmp + i * 4 + 1, mp1_x, mp1_y, 0);
193 evas_map_point_coord_set(map, cmp + i * 4 + 2, mp2_x, mp2_y, 0); 200 evas_map_point_coord_set(map, cmp + i * 4 + 2, mp2_x, mp2_y, 0);