summaryrefslogtreecommitdiff
path: root/src/tests/evas/evas_test_textblock.c
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2020-09-01 19:39:13 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-09-01 19:39:13 +0900
commit6e025575350276a0f43ffc33ade696e6bffca395 (patch)
treeaf9573fe682a3c03f16f779342b384b1c7b69e54 /src/tests/evas/evas_test_textblock.c
parent1ab71284db89dcc37da12dd56796e892bc50ae0a (diff)
downloadefl-6e025575350276a0f43ffc33ade696e6bffca395.tar.gz
evas_textblock: remove style padding from native width and formatted height
Summary: The style padding was included in native width(not in native height) and formatted height(not in formatted width). This is so weired. In addition, there is no enough document about the relation between formatted size, native size and the style padding. This issue is caused by a confusing code which is about how to handle the style padding on item's width and height.("x_adjustment"!) When Evas calculates "c->wmax" in line finalization stage, it explicitly subtract style padding from line width. So, I assumed the formatted size has not to include style padding. It is same for the native size. The style padding will not be included in formatted size and native size by this commit. @fix Test Plan: A test case is included in this commit. Evas_Object *tb = evas_object_textblock_add(evas); newst = evas_textblock_style_new(); evas_textblock_style_set(newst, "DEFAULT='font=Sans font_size=50 color=#000 text_class=entry'"); evas_object_textblock_style_set(tb, newst); evas_object_textblock_text_markup_set(tb, "<style=far_soft_shadow>Test</>"); evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); fail_if((l != 0) || (r != 4) || (t != 0) || (b != 4)); /* Size with style padding */ evas_object_textblock_size_formatted_get(tb, &w, &h); evas_object_textblock_size_native_get(tb, &nw, &nh); /* It is non-sense if the following condition is true. */ fail_if((w + l + r == nw) && (h == nh + t + b)); Reviewers: raster, ali.alzyod, woohyun, bowonryu Reviewed By: ali.alzyod Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12110
Diffstat (limited to 'src/tests/evas/evas_test_textblock.c')
-rw-r--r--src/tests/evas/evas_test_textblock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index b3177ff599..3f1cbec8d8 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -3736,6 +3736,13 @@ EFL_START_TEST(evas_textblock_style)
evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b);
fail_if((l != 0) || (r != 4) || (t != 0) || (b != 4));
+ /* Size with style padding */
+ evas_object_textblock_size_formatted_get(tb, &w, &h);
+ evas_object_textblock_size_native_get(tb, &nw, &nh);
+
+ /* It is non-sense if the following condition is true. */
+ fail_if((w + l + r == nw) && (h == nh + t + b));
+
/* Mixed style padding */
evas_object_textblock_text_markup_set(tb,
"<style=far_shadow>Test</><style=far_soft_shadow>Test</>");