usp10: Clusters are represented by glyph indices not character positions.

This commit is contained in:
Huw Davies 2013-02-20 09:51:10 +00:00 committed by Alexandre Julliard
parent ab2eb34a82
commit 5e5d8d215b

View File

@ -2534,8 +2534,9 @@ HRESULT WINAPI ScriptCPtoX(int iCP,
if (check >= cChars && !iMaxPos)
{
for (check = clust; check < cChars; check++)
special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, check, 1);
int glyph;
for (glyph = clust; glyph < cGlyphs; glyph++)
special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, glyph, 1);
iSpecial = item;
special_size /= (cChars - item);
iPosX += special_size;
@ -2666,8 +2667,9 @@ HRESULT WINAPI ScriptXtoCP(int iX,
if (check >= cChars && direction > 0)
{
for (check = clust; check < cChars; check++)
special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, check, direction);
int glyph;
for (glyph = clust; glyph < cGlyphs; glyph++)
special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, glyph, direction);
iSpecial = item;
special_size /= (cChars - item);
iPosX += special_size;