summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <hirt.danny@gmail.com>2017-08-21 12:43:19 +0300
committerDaniel Hirt <hirt.danny@gmail.com>2017-08-24 12:17:21 +0300
commitf696cc88933bfa1ac6e5d6da26bc9ba7b2c3e2fa (patch)
treef20b1dc14a33f91cda9771e760ecbb4f40e74a01
parentc017ab2dc057fa6af25af8252a530b3f627902b3 (diff)
Canvas text: move obstacles logic to proper place
Will likely reduce number of update requests.
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 37f8230140..7002387f47 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -2868,6 +2868,7 @@ struct _Ctxt
2868 Textblock_Position position; 2868 Textblock_Position position;
2869 Evas_Textblock_Align_Auto align_auto : 2; 2869 Evas_Textblock_Align_Auto align_auto : 2;
2870 Eina_Bool width_changed : 1; 2870 Eina_Bool width_changed : 1;
2871 Eina_Bool handle_obstacles : 1;
2871}; 2872};
2872 2873
2873static void _layout_text_add_logical_item(Ctxt *c, Evas_Object_Textblock_Text_Item *ti, Eina_List *rel); 2874static void _layout_text_add_logical_item(Ctxt *c, Evas_Object_Textblock_Text_Item *ti, Eina_List *rel);
@@ -5461,9 +5462,6 @@ _layout_par(Ctxt *c)
5461 char *line_breaks = NULL; 5462 char *line_breaks = NULL;
5462 char *word_breaks = NULL; 5463 char *word_breaks = NULL;
5463 5464
5464 /* Obstacles logic */
5465 Eina_Bool handle_obstacles = EINA_FALSE;
5466
5467 if (!c->par->logical_items) 5465 if (!c->par->logical_items)
5468 return 2; 5466 return 2;
5469 5467
@@ -5507,13 +5505,6 @@ _layout_par(Ctxt *c)
5507 return 0; 5505 return 0;
5508 } 5506 }
5509 5507
5510 /* Update all obstacles */
5511 if (c->o->obstacle_changed || c->width_changed)
5512 {
5513 _layout_obstacles_update(c);
5514 handle_obstacles = EINA_TRUE;
5515 }
5516
5517 c->par->text_node->dirty = EINA_FALSE; 5508 c->par->text_node->dirty = EINA_FALSE;
5518 c->par->text_node->is_new = EINA_FALSE; 5509 c->par->text_node->is_new = EINA_FALSE;
5519 c->par->rendered = EINA_FALSE; 5510 c->par->rendered = EINA_FALSE;
@@ -5618,7 +5609,7 @@ _layout_par(Ctxt *c)
5618 } 5609 }
5619 } 5610 }
5620 5611
5621 if (handle_obstacles && !obs) 5612 if (c->handle_obstacles && !obs)
5622 { 5613 {
5623 obs = _layout_item_obstacle_get(c, it); 5614 obs = _layout_item_obstacle_get(c, it);
5624 } 5615 }
@@ -6349,6 +6340,12 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6349 c->obs_infos = NULL; 6340 c->obs_infos = NULL;
6350 c->hyphen_ti = NULL; 6341 c->hyphen_ti = NULL;
6351 6342
6343 /* Update all obstacles */
6344 if (c->o->obstacle_changed || c->width_changed)
6345 {
6346 _layout_obstacles_update(c);
6347 c->handle_obstacles = EINA_TRUE;
6348 }
6352 /* Start of logical layout creation */ 6349 /* Start of logical layout creation */
6353 /* setup default base style */ 6350 /* setup default base style */
6354 { 6351 {