evas/textblock: apply style paddings in fit calculation 77/245977/1
authorYoungbok Shin <youngb.shin@samsung.com>
Wed, 21 Oct 2020 05:45:05 +0000 (14:45 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Wed, 21 Oct 2020 05:45:05 +0000 (14:45 +0900)
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

index 102feb4..dad5598 100644 (file)
@@ -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;