summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2020-10-28 14:50:23 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-10-28 14:50:23 +0900
commit94c2d2295f5effea80a21031d84a5ef370a93ef3 (patch)
tree8540a9251687281474503b97dc11b37838b029df
parente9ee9cc3a0c414ec2a14a0817e89c4a46c8f93f0 (diff)
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
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c7
1 files 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)
17793 } 17793 }
17794 else 17794 else
17795 { 17795 {
17796 int pad_l, pad_r, pad_t, pad_b;
17797
17796 fit_style_update(eo_obj,fc->p_size_array[mid],EINA_TRUE,bwrap); 17798 fit_style_update(eo_obj,fc->p_size_array[mid],EINA_TRUE,bwrap);
17797 Eina_Size2D size = efl_canvas_textblock_size_formatted_get(eo_obj); 17799 Eina_Size2D size = efl_canvas_textblock_size_formatted_get(eo_obj);
17798 wf_new = size.w; 17800 efl_canvas_textblock_style_insets_get(eo_obj, &pad_l, &pad_r, &pad_t, &pad_b);
17799 hf_new = size.h; 17801 wf_new = size.w + pad_l + pad_r;
17802 hf_new = size.h + pad_t + pad_b;
17800 if (fc->p_size_array[mid]<255) 17803 if (fc->p_size_array[mid]<255)
17801 { 17804 {
17802 fc->size_cache[font_size].w = wf_new; 17805 fc->size_cache[font_size].w = wf_new;