summaryrefslogtreecommitdiff
path: root/legacy/edje/src/lib/edje_text.c
diff options
context:
space:
mode:
authorStafford Mitchell Horne <shorne@gmail.com>2007-05-03 23:15:09 +0000
committerStafford Mitchell Horne <shorne@gmail.com>2007-05-03 23:15:09 +0000
commit61bda22a702bb9721422591861b6ac78d9f7abf3 (patch)
tree2f269a23fc088c7d8282dfdf65a031e2fe77a6a7 /legacy/edje/src/lib/edje_text.c
parent405dcfc6334684da2dcc0f6d8b578e7b758430a8 (diff)
Add negative font size handling in text_classes
* negative size is a multiplier for the origianl size i.e. : -100 = 1.0x; -120 = 1.2x SVN revision: 29835
Diffstat (limited to 'legacy/edje/src/lib/edje_text.c')
-rw-r--r--legacy/edje/src/lib/edje_text.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index 64eb706..deae9ef 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -296,7 +296,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
296 if (tc) 296 if (tc)
297 { 297 {
298 if (tc->font) font = tc->font; 298 if (tc->font) font = tc->font;
299 if (tc->size > 0) size = tc->size; 299 size = _edje_text_size_calc(size, tc);
300 } 300 }
301 } 301 }
302 302
@@ -585,3 +585,23 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
585 if (font2) 585 if (font2)
586 free(font2); 586 free(font2);
587} 587}
588
589Evas_Font_Size
590_edje_text_size_calc(Evas_Font_Size size, Edje_Text_Class *tc)
591{
592 int val;
593
594 if (tc->size == 0)
595 {
596 val = size;
597 }
598 else if (tc->size > 0.0)
599 {
600 val = tc->size;
601 }
602 else
603 {
604 val = (size * -tc->size) / 100;
605 }
606 return val;
607}