Bug 282579 - fix logic for placing characters when falling off the end

of a textPath.  r=jwatt
This commit is contained in:
tor%cs.brown.edu 2005-08-26 21:13:48 +00:00
Родитель f6f5604c98
Коммит 69cef9f8b7
1 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -904,19 +904,20 @@ nsSVGGlyphFrame::GetCharacterPosition(nsSVGCharacterPosition **aCharacterPositio
nsSVGCharacterPosition *cp = new nsSVGCharacterPosition[strLength];
for (PRUint32 k = 0; k < strLength; k++)
cp[k].draw = PR_FALSE;
float x = mX;
for (PRUint32 i = 0; i < strLength; i++) {
float advance;
mMetrics->GetAdvanceOfChar(i, &advance);
if (x + advance/2 > length) {
cp[i].draw = PR_FALSE;
continue;
}
/* have we run off the end of the path? */
if (x + advance/2 > length)
break;
if (x + advance/2 < 0.0f)
cp[i].draw = PR_FALSE;
else {
/* check that we've advanced to the start of the path */
if (x + advance/2 >= 0.0f) {
cp[i].draw = PR_TRUE;
// add y (normal)