aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_object_textblock.c
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 /src/lib/evas/canvas/evas_object_textblock.c
parentdocs: Add information about texture size limitations (diff)
downloadefl-f696cc88933bfa1ac6e5d6da26bc9ba7b2c3e2fa.tar.gz
Canvas text: move obstacles logic to proper place
Will likely reduce number of update requests.
Diffstat (limited to '')
-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
Textblock_Position position;
Evas_Textblock_Align_Auto align_auto : 2;
Eina_Bool width_changed : 1;
+ Eina_Bool handle_obstacles : 1;
};
static 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)
char *line_breaks = NULL;
char *word_breaks = NULL;
- /* Obstacles logic */
- Eina_Bool handle_obstacles = EINA_FALSE;
-
if (!c->par->logical_items)
return 2;
@@ -5507,13 +5505,6 @@ _layout_par(Ctxt *c)
return 0;
}
- /* Update all obstacles */
- if (c->o->obstacle_changed || c->width_changed)
- {
- _layout_obstacles_update(c);
- handle_obstacles = EINA_TRUE;
- }
-
c->par->text_node->dirty = EINA_FALSE;
c->par->text_node->is_new = EINA_FALSE;
c->par->rendered = EINA_FALSE;
@@ -5618,7 +5609,7 @@ _layout_par(Ctxt *c)
}
}
- if (handle_obstacles && !obs)
+ if (c->handle_obstacles && !obs)
{
obs = _layout_item_obstacle_get(c, it);
}
@@ -6349,6 +6340,12 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
c->obs_infos = NULL;
c->hyphen_ti = NULL;
+ /* Update all obstacles */
+ if (c->o->obstacle_changed || c->width_changed)
+ {
+ _layout_obstacles_update(c);
+ c->handle_obstacles = EINA_TRUE;
+ }
/* Start of logical layout creation */
/* setup default base style */
{