Bug 347437 - Marker elements sometimes point backwards.

Patch by amenzie@us.ibm.com, r=tor, sr=bz
This commit is contained in:
tor%cs.brown.edu 2006-08-30 20:29:45 +00:00
Родитель ac84673b0b
Коммит 8f4227815a
1 изменённых файлов: 11 добавлений и 4 удалений

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

@ -348,10 +348,17 @@ nsSVGUtils::GetSurface(nsSVGOuterSVGFrame *aOuterSVGFrame,
float
nsSVGUtils::AngleBisect(float a1, float a2)
{
if (a2 - a1 < M_PI)
return (a1+a2)/2;
else
return M_PI + (a1+a2)/2;
float delta = fmod(a2 - a1, NS_STATIC_CAST(float, 2*M_PI));
if (delta < 0) {
delta += 2*M_PI;
}
/* delta is now the angle from a1 around to a2, in the range [0, 2*M_PI) */
float r = a1 + delta/2;
if (delta >= M_PI) {
/* the arc from a2 to a1 is smaller, so use the ray on that side */
r += M_PI;
}
return r;
}
nsSVGOuterSVGFrame *