forked from enlightenment/efl
Evas bidi: Fix line reordering.
We passed the wrong offset of the embedding level, moved to just using the offset part of the API. Also, Fribidi expects v_to_l to point to the start of a (start + len) sized buffer, fixed that as well. SVN revision: 60304
This commit is contained in:
parent
36b21249d9
commit
cd91e94255
|
@ -418,18 +418,15 @@ evas_bidi_props_reorder_line(Eina_Unicode *eina_ustr, size_t start, size_t len,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shaping must be done *BEFORE* breaking to lines so there's no choice but
|
|
||||||
doing it in textblock. */
|
|
||||||
{
|
{
|
||||||
/* FIXME: Hack around fribidi altering embedding_levels */
|
|
||||||
EvasBiDiLevel *emb_lvl;
|
EvasBiDiLevel *emb_lvl;
|
||||||
emb_lvl = malloc(len * sizeof(EvasBiDiLevel));
|
emb_lvl = malloc((start + len) * sizeof(EvasBiDiLevel));
|
||||||
memcpy(emb_lvl, props->embedding_levels, len * sizeof(EvasBiDiLevel));
|
memcpy(emb_lvl, props->embedding_levels,
|
||||||
if (!fribidi_reorder_line (FRIBIDI_FLAGS_DEFAULT,
|
(start + len) * sizeof(EvasBiDiLevel));
|
||||||
props->char_types + start,
|
/* We pass v_to_l - start, because fribidi assumes start is the offset
|
||||||
len, 0, props->direction,
|
* from the start of v_to_l as well, not just the props. */
|
||||||
emb_lvl,
|
if (!fribidi_reorder_line (FRIBIDI_FLAGS_DEFAULT, props->char_types,
|
||||||
ustr, v_to_l))
|
len, start, props->direction, emb_lvl, ustr, v_to_l - start))
|
||||||
{
|
{
|
||||||
free(emb_lvl);
|
free(emb_lvl);
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Reference in New Issue