summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_textblock.c
diff options
context:
space:
mode:
authorali <ali198724@gmail.com>2019-07-29 20:18:37 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-07-31 10:54:55 -0700
commit32cffb4494c46fa3705062c8e43294bf8f5eca87 (patch)
treeaf920b99b04ae43933f10f98d5b841523edc80eb /src/lib/evas/canvas/evas_object_textblock.c
parent6d0f51412626b13e495a3eed559880b1266403f7 (diff)
evas_textblock: change font-size/font-family only using EFL.Text.Font Interface
Currently: User cannot change font size only, he needs to set both font and font size with (**efl_text_font_font_set**) To change size only, you need to make two calls, one to get font (**efl_text_font_font_get**) , then pass it again with new size to (**efl_text_font_font_set**). New Behaviour: If user want to change size only, then he passes NULL as font argument to keep same font. If user want to change font only, then he passes 0 as font-size argument, to keep same font-size. Notes: This is not best solution, but it better than current behaviour. I think best solution to have separate function to set font size, but It might break current api or duplicate functions. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9158
Diffstat (limited to 'src/lib/evas/canvas/evas_object_textblock.c')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 510f6ce..1135527 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -15808,13 +15808,13 @@ _efl_canvas_text_efl_text_font_font_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Dat
15808 15808
15809 Eina_Stringshare *nfont; 15809 Eina_Stringshare *nfont;
15810 15810
15811 if (o->default_format.info.size != size) 15811 if (size > 0 && o->default_format.info.size != size)
15812 { 15812 {
15813 o->default_format.info.size = size; 15813 o->default_format.info.size = size;
15814 changed = EINA_TRUE; 15814 changed = EINA_TRUE;
15815 } 15815 }
15816 15816
15817 if (o->default_format.info.font != font) 15817 if (font && o->default_format.info.font != font)
15818 { 15818 {
15819 nfont = eina_stringshare_add(font); 15819 nfont = eina_stringshare_add(font);
15820 if (nfont == _FMT_INFO(font)) 15820 if (nfont == _FMT_INFO(font))