From 5e0a6e2fbf6501b049ef2998d161e3e2fac055a5 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Wed, 21 Oct 2020 14:45:05 +0900 Subject: [PATCH] evas/textblock: apply style paddings in fit calculation The style paddings should be calculated for fitting text into the given object's size. @fix Change-Id: Id68a23c7ec63e3874ff2ff70fdf838ad2092612e --- src/lib/evas/canvas/evas_object_textblock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 102feb4..dad5598 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -18538,10 +18538,13 @@ int fit_text_block(Evas_Object *eo_obj) } else { + int pad_l, pad_r, pad_t, pad_b; + fit_style_update(eo_obj,fc->p_size_array[mid],EINA_TRUE,bwrap); Eina_Size2D size = efl_canvas_textblock_size_formatted_get(eo_obj); - wf_new = size.w; - hf_new = size.h; + efl_canvas_textblock_style_insets_get(eo_obj, &pad_l, &pad_r, &pad_t, &pad_b); + wf_new = size.w + pad_l + pad_r; + hf_new = size.h + pad_t + pad_b; if (fc->p_size_array[mid]<255) { fc->size_cache[font_size].w = wf_new; -- 2.7.4