From b031bbee9bf0b66bbe125abfaf066cd90042879a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 6 Oct 2015 20:18:32 +0900 Subject: [PATCH] Evas textblock: Force relayout during proxy render If the textblock object was not visible in the main canvas, but still needs to be rendered in a proxy surface, then _relayout may not have been called. This forces generation of paragraphs based on the current geometry. This patch is ugly. I know. This is evas render :) --- src/lib/evas/canvas/evas_object_textblock.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index ce419c2423..ca37af462b 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -11566,6 +11566,17 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, {0, 1, 2, 1, 0} }; + /* [FIXME!!!] rare case when relayout was not called: cache.clip made + * the object not visible (eg. clipped out), but it is actually visible + * in this context (eg. inside a proxy) - UGLY DIRTY FIX */ + if (obj->layer->evas->is_frozen && + (o->changed || o->content_changed || o->format_changed || o->obstacle_changed)) + _relayout_if_needed(eo_obj, o); + + /* If there are no paragraphs and thus there are no lines, + * there's nothing left to do. */ + if (!o->paragraphs) return; + /* render object to surface with context, and offxet by x,y */ ENFN->context_multiplier_unset(output, context); ENFN->context_multiplier_set(output, context, 0, 0, 0, 0); @@ -11577,9 +11588,6 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, obj->cur->geometry.w, obj->cur->geometry.h); clip = ENFN->context_clip_get(output, context, &cx, &cy, &cw, &ch); - /* If there are no paragraphs and thus there are no lines, - * there's nothing left to do. */ - if (!o->paragraphs) return; ENFN->context_color_set(output, context, 0, 0, 0, 0); ca = cr = cg = cb = 0;