wrap -= it->text_pos; /* Cut here */
}
}
-
- if (wrap > 0)
+ if ((wrap >= 0) && ((size_t) wrap == it_len))
+ {
+ /* Can happen if this is the last word in the paragraph */
+ adv_line = 0;
+ }
+ else if (wrap > 0)
{
if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT)
{
redo_item = 1;
_layout_line_advance(c, it->format);
}
+ else // (wrap < 0)
+ {
+ /* avoid line advance if there is no wrapping point */
+ adv_line = 0;
+ }
/* Reset wrap */
wrap = -1;
}
}
fail_if(w != bw);
+ /* Verify that no empty line is added */
+ evas_object_textblock_text_markup_set(tb, "<wrap=word>Hello</wrap>");
+ evas_object_textblock_size_native_get(tb, NULL, &nh);
+ evas_object_resize(tb, 0, 1000);
+ evas_object_textblock_size_formatted_get(tb, NULL, &h);
+ ck_assert_int_eq(nh, h);
+
+ evas_object_textblock_text_markup_set(tb, "<wrap=char>a</wrap>");
+ evas_object_textblock_size_native_get(tb, NULL, &nh);
+ evas_object_resize(tb, 0, 1000);
+ evas_object_textblock_size_formatted_get(tb, NULL, &h);
+ ck_assert_int_eq(nh, h);
+
/* Word wrap */
evas_object_textblock_text_markup_set(tb, "aaaaaa");
evas_object_textblock_size_formatted_get(tb, &bw, &bh);