forked from enlightenment/efl
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:
parent
ad1af73d40
commit
2e809f845f
|
@ -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);
|
||||
|
|
|
@ -823,6 +823,7 @@ struct _Edje_Calc_Params
|
|||
struct {
|
||||
Edje_Alignment align; /* text alignment within bounds */
|
||||
double elipsis;
|
||||
int size;
|
||||
} text;
|
||||
struct {
|
||||
int id;
|
||||
|
|
|
@ -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) &&
|
||||
|
|
Loading…
Reference in New Issue