fix! textblokc word wrap and spec.in

SVN revision: 13686
This commit is contained in:
Carsten Haitzler 2005-03-11 04:54:35 +00:00
parent 5856cddd6f
commit 24cb66cd71
2 changed files with 35 additions and 14 deletions

View File

@ -7,7 +7,7 @@ Release: 1
License: BSD
Group: System Environment/Libraries
URL: http://www.enlightenment.org/
Source: %{name}-%{version}_pre13.tar.gz
Source: %{name}-%{version}.tar.gz
Packager: %{?_packager:%{_packager}}%{!?_packager:Michael Jennings <mej@eterm.org>}
Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:The Enlightenment Project (http://www.enlightenment.org/)}
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}

View File

@ -974,7 +974,8 @@ evas_object_textblock_layout_internal(Evas_Object *obj, int w, int h, int *forma
int pad_l = 0, pad_r = 0, pad_t = 0, pad_b = 0;
int marginl = 0, marginr = 0;
int ww, hh;
int just_wrapped = 0;
o = (Evas_Object_Textblock *)(obj->object_data);
ww = w;
hh = h;
@ -1266,6 +1267,16 @@ evas_object_textblock_layout_internal(Evas_Object *obj, int w, int h, int *forma
text = strdup(node->text);
new_node:
if (just_wrapped)
{
int pos, chr;
pos = 0;
chr = evas_common_font_utf8_get_next(text, &pos);
if (evas_object_textblock_char_is_white(chr))
strcpy(text, text + pos);
}
just_wrapped = 0;
/* FIXME: we cant do this - we need to be able to qury text
* overflow amounts */
/*
@ -1408,23 +1419,33 @@ evas_object_textblock_layout_internal(Evas_Object *obj, int w, int h, int *forma
}
else
{
chr = evas_common_font_utf8_get_next(text, &ppos);
if (ppos < 0) ppos = 0;
chrpos = ppos;
while ((evas_object_textblock_char_is_white(chr))
&&
(pos >= 0) &&
(chr > 0))
if (ppos == 0)
{
ppos = pos;
chr = evas_common_font_utf8_get_prev(text, &pos);
nchrpos = 0;
chrpos--;
}
else
{
chr = evas_common_font_utf8_get_next(text, &ppos);
if (ppos < 0) ppos = 0;
chrpos = ppos;
while
((evas_object_textblock_char_is_white(chr))
&&
(pos >= 0) &&
(chr > 0))
{
ppos = pos;
chr = evas_common_font_utf8_get_prev(text, &pos);
}
chr = evas_common_font_utf8_get_next(text, &ppos);
if (ppos < 0) ppos = 0;
nchrpos = ppos;
}
chr = evas_common_font_utf8_get_next(text, &ppos);
if (ppos < 0) ppos = 0;
nchrpos = ppos;
}
}
}
just_wrapped = 1;
/* if the first char in the line can't fit!!! */
if ((chrpos == 0) && (lnode == line_start))
{