summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2018-11-14 09:19:30 +0200
committerDaniel Hirt <hirt.danny@gmail.com>2018-11-14 10:48:54 +0200
commit09da85807a6447d6e9c04fc72fdb485a78192d82 (patch)
tree30c1f012b952aac22c2d3a7d63ae6febb45aba8b /src/lib/evas
parentb89b221b97897a29d009fc5910274c545d33e06f (diff)
evas textblock: remove white space after line-break by a next item
Summary: In some cases, white space at end of line is remained after line-break. This issue is happened when Textblock do word wrap at the next item. Without spliting a previous text item. Then, Textblock just skipped calling _layout_item_text_split_strip_white() function. This patch also fixed a wrong test case based on wrong logic. The range rectangles shouldn't be overlapped. Because of remained white space, a meaningless rectangle was added. And it overlapped by next rectangle. @fix Test Plan: Fixed an exising test case for range renctangles. Run test case. Reviewers: herdsman, woohyun, raster, cedric, subodh, subodh6129 Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7204
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index a194899d48..3da95a97a0 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -5564,7 +5564,7 @@ _layout_item_obstacle_get(Ctxt *c, Evas_Object_Textblock_Item *it);
5564static int 5564static int
5565_layout_par(Ctxt *c) 5565_layout_par(Ctxt *c)
5566{ 5566{
5567 Evas_Object_Textblock_Item *it; 5567 Evas_Object_Textblock_Item *it, *prev_it;
5568 Eina_List *i; 5568 Eina_List *i;
5569 int ret = 0; 5569 int ret = 0;
5570 int wrap = -1; 5570 int wrap = -1;
@@ -5673,6 +5673,7 @@ _layout_par(Ctxt *c)
5673 Eina_Bool item_preadv = EINA_FALSE; 5673 Eina_Bool item_preadv = EINA_FALSE;
5674 Evas_Textblock_Obstacle *obs = NULL; 5674 Evas_Textblock_Obstacle *obs = NULL;
5675 c->par->last_fw = 0; 5675 c->par->last_fw = 0;
5676 it = NULL;
5676 for (i = c->par->logical_items ; i ; ) 5677 for (i = c->par->logical_items ; i ; )
5677 { 5678 {
5678 Evas_Coord prevdescent = 0, prevascent = 0; 5679 Evas_Coord prevdescent = 0, prevascent = 0;
@@ -5681,6 +5682,7 @@ _layout_par(Ctxt *c)
5681 Evas_Textblock_Obstacle_Info *obs_info = NULL; 5682 Evas_Textblock_Obstacle_Info *obs_info = NULL;
5682 Evas_Coord itw; 5683 Evas_Coord itw;
5683 5684
5685 prev_it = it;
5684 it = _ITEM(eina_list_data_get(i)); 5686 it = _ITEM(eina_list_data_get(i));
5685 /* Skip visually deleted items */ 5687 /* Skip visually deleted items */
5686 if (it->visually_deleted || 5688 if (it->visually_deleted ||
@@ -5959,6 +5961,12 @@ _layout_par(Ctxt *c)
5959 else if (wrap == 0) 5961 else if (wrap == 0)
5960 { 5962 {
5961 /* Should wrap before the item */ 5963 /* Should wrap before the item */
5964 if (prev_it && (prev_it->type == EVAS_TEXTBLOCK_ITEM_TEXT))
5965 {
5966 _layout_item_text_split_strip_white(c,
5967 _ITEM_TEXT(prev_it), eina_list_prev(i),
5968 _ITEM_TEXT(prev_it)->text_props.text_len);
5969 }
5962 5970
5963 /* We didn't end up using the item, so revert the ascent 5971 /* We didn't end up using the item, so revert the ascent
5964 * and descent changes. */ 5972 * and descent changes. */