descent = *maxdescent;
if (fmt->linesize > 0)
{
- if ((ascent + descent) < fmt->linesize)
+ int scaled_linesize = fmt->linesize * obj->cur->scale;
+ if ((ascent + descent) < scaled_linesize)
{
ascent = ((fmt->linesize * ascent) / (ascent + descent));
descent = fmt->linesize - ascent;
descent = descent * fmt->linerelsize;
ascent = ascent * fmt->linerelsize;
}
- descent += fmt->linegap;
+ descent += fmt->linegap * obj->cur->scale;
descent += ((ascent + descent) * fmt->linerelgap);
if (*maxascent < ascent) *maxascent = ascent;
if (*maxdescent < descent) *maxdescent = descent;
START_TB_TEST();
const char *buf = "Th<b>i<font_size=15 wrap=none>s i</font_size=13>s</> a <br/> te<ps/>st<item></>.";
const Evas_Object_Textblock_Node_Format *fnode;
+ Evas_Coord w, h, nw, nh;
evas_object_textblock_text_markup_set(tb, buf);
/* Walk from the start */
/* Format text nodes invalidation */
{
- Evas_Coord w, h, nw, nh;
evas_object_textblock_text_markup_set(tb, "Test");
evas_object_textblock_size_formatted_get(tb, &w, &h);
evas_textblock_cursor_paragraph_first(cur);
evas_object_textblock_text_markup_set(tb, "f<color=#f00>i</color>f");
evas_object_textblock_size_formatted_get(tb, NULL, NULL);
+ /* Scaling Line size */
+ evas_object_scale_set(tb, 1.0);
+ evas_object_textblock_text_markup_set(tb, "<linesize=100>Line size 100</linesize>");
+ evas_object_resize(tb, 400, 400);
+ evas_object_textblock_size_formatted_get(tb, NULL, &h);
+ ck_assert_int_ge(h, 100);
+
+ evas_object_scale_set(tb, 2.0);
+ evas_object_textblock_size_formatted_get(tb, NULL, &h);
+ ck_assert_int_ge(h, 200);
+
+ /* Scaling Line gap */
+ evas_object_scale_set(tb, 1.0);
+ evas_object_textblock_text_markup_set(tb, "<linegap=100>Line gap 100</linegap>");
+ evas_object_resize(tb, 50, 400);
+ evas_object_textblock_size_formatted_get(tb, NULL, &h);
+ ck_assert_int_ge(h, 100);
+
+ evas_object_scale_set(tb, 2.0);
+ evas_object_textblock_size_formatted_get(tb, NULL, &h);
+ ck_assert_int_ge(h, 200);
+
+ /* Restore scale */
+ evas_object_scale_set(tb, 1.0);
+
END_TB_TEST();
}
END_TEST