Bug 306547 - textPath not working on path using closepath command. r=afri

This commit is contained in:
tor%cs.brown.edu 2005-09-06 20:40:05 +00:00
Родитель b2af0e7c09
Коммит 1e7ca0194c
2 изменённых файлов: 21 добавлений и 17 удалений

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

@ -587,11 +587,14 @@ nsSVGCairoPathGeometry::Flatten(nsSVGPathData **aData)
break;
case CAIRO_PATH_CLOSE_PATH:
{
if (!(*aData)->count)
break;
/* find beginning of current subpath */
for (PRUint32 i = (*aData)->count; i >= 0; i--)
if ((*aData)->type[i] = NS_SVGPATHFLATTEN_MOVE) {
(*aData)->AddPoint((*aData)->x[i],
(*aData)->y[i],
for (PRUint32 k = (*aData)->count - 1; k >= 0; k--)
if ((*aData)->type[k] == NS_SVGPATHFLATTEN_MOVE) {
(*aData)->AddPoint((*aData)->x[k],
(*aData)->y[k],
NS_SVGPATHFLATTEN_LINE);
break;
}

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

@ -648,8 +648,8 @@ nsSVGGDIPlusPathGeometry::Flatten(nsSVGPathData **aData)
*aData = new nsSVGPathData;
for (PRInt32 i = 0; i< pdata.Count; i++) {
switch (pdata.Types[i]) {
for (PRInt32 i = 0; i < pdata.Count; i++) {
switch (pdata.Types[i] & PathPointTypePathTypeMask) {
case PathPointTypeStart:
(*aData)->AddPoint(pdata.Points[i].X,
pdata.Points[i].Y,
@ -660,21 +660,22 @@ nsSVGGDIPlusPathGeometry::Flatten(nsSVGPathData **aData)
pdata.Points[i].Y,
NS_SVGPATHFLATTEN_LINE);
break;
case PathPointTypeCloseSubpath:
{
/* find beginning of current subpath */
for (PRUint32 i = (*aData)->count; i >= 0; i--)
if ((*aData)->type[i] = NS_SVGPATHFLATTEN_MOVE) {
(*aData)->AddPoint((*aData)->x[i],
(*aData)->y[i],
NS_SVGPATHFLATTEN_LINE);
break;
}
}
default:
/* should never happen with a flattened path */
break;
}
if ((pdata.Types[i] & PathPointTypeCloseSubpath) &&
(*aData)->count) {
/* find beginning of current subpath */
for (PRUint32 k = (*aData)->count - 1; k >= 0; k--)
if ((*aData)->type[k] == NS_SVGPATHFLATTEN_MOVE) {
(*aData)->AddPoint((*aData)->x[k],
(*aData)->y[k],
NS_SVGPATHFLATTEN_LINE);
break;
}
}
}
return NS_OK;