Interpolate text font size.

Often requested for animations that want to grow or shrink text
quickly. This is a faster alternative to using geometry with rel1/rel2
and "text.fit: 1 1;" since it does not need to figure out which size
fits better into that object.

I tested and it does not seem to introduce any regression. Also
checked with scale and text_class variations.



SVN revision: 38958
This commit is contained in:
Gustavo Sverzut Barbieri 2009-02-05 18:15:34 +00:00
parent ad1af73d40
commit 2e809f845f
3 changed files with 17 additions and 0 deletions

View File

@ -867,6 +867,18 @@ _edje_part_recalc_single(Edje *ed,
}
if (sfont) free(sfont);
}
if (ep->part->type == EDJE_PART_TYPE_TEXT)
{
const char *font;
char *sfont = NULL;
int size;
font = _edje_text_class_font_get(ed, desc, &size, &sfont);
free(sfont);
params->text.size = size;
}
/* rememebr what our size is BEFORE we go limit it */
params->req.x = params->x;
params->req.y = params->y;
@ -1469,6 +1481,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
}
break;
case EDJE_PART_TYPE_TEXT:
p3.text.size = INTP(p1.text.size, p2.text.size, pos);
case EDJE_PART_TYPE_TEXTBLOCK:
p3.color2.r = INTP(p1.color2.r, p2.color2.r, pos);
p3.color2.g = INTP(p1.color2.g, p2.color2.g, pos);

View File

@ -823,6 +823,7 @@ struct _Edje_Calc_Params
struct {
Edje_Alignment align; /* text alignment within bounds */
double elipsis;
int size;
} text;
struct {
int id;

View File

@ -392,6 +392,9 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
sw = params->w;
sh = params->h;
}
size = params->text.size;
if ((ep->text.cache.in_size == size) &&
(ep->text.cache.in_w == sw) &&
(ep->text.cache.in_h == sh) &&