woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=94c2d2295f5effea80a21031d84a5ef370a93ef3

commit 94c2d2295f5effea80a21031d84a5ef370a93ef3
Author: Youngbok Shin <[email protected]>
Date:   Wed Oct 28 14:50:23 2020 +0900

    evas/textblock: apply style paddings in fit calculation
    
    Summary:
    The style paddings should be calculated for fitting text into
    the given object's size.
    
    Test Plan:
    1. Put shadow effect in your style string.
    "... style=shadow,far_bottom shadow_color=#000 ..."
    
    2. Apply fit option( and ellipsis to see how it goes wrong without this 
patch.)
    
    3. See results.
    
    Reviewers: woohyun, ali.alzyod
    
    Reviewed By: woohyun, ali.alzyod
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D12183
---
 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 77f3d3d07a..c8fd924b78 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -17793,10 +17793,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;

-- 


Reply via email to