tom - can u take thgis textblock fit code and run with it and polish

it to be nice and try and "fit" as best as possible? entries dont do it.



SVN revision: 72992
This commit is contained in:
Carsten Haitzler 2012-06-28 10:19:30 +00:00
parent 6d605629ca
commit 72b6266d7c
1 changed files with 26 additions and 0 deletions

View File

@ -1252,6 +1252,32 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
if (*maxh < *minh) *maxh = *minh;
}
}
if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y))
{
double s = 1.0;
if (ep->part->scale) s = TO_DOUBLE(sc);
evas_object_scale_set(ep->object, s);
evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
if (chosen_desc->text.fit_x)
{
if ((tw > 0) && (tw > params->w))
{
s = (s * params->w) / (double)tw;
evas_object_scale_set(ep->object, s);
evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
}
}
if (chosen_desc->text.fit_y)
{
if ((th > 0) && (th > params->h))
{
s = (s * params->h) / (double)th;
evas_object_scale_set(ep->object, s);
evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
}
}
}
evas_object_textblock_valign_set(ep->object, TO_DOUBLE(chosen_desc->text.align.y));
}
}