Bug 931996 - Add an AppendEllipseToPath helper to Moz2D. r=Bas

--HG--
extra : rebase_source : 75592379b93e5574ff1bb4116ce8b90b62c4f8a1
This commit is contained in:
Jonathan Watt 2013-11-01 13:30:00 +00:00
Родитель c8e8bf08fb
Коммит f653c95e6e
2 изменённых файлов: 23 добавлений и 0 удалений

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

@ -150,6 +150,18 @@ AppendRoundedRectToPath(PathBuilder* aPathBuilder,
aPathBuilder->Close();
}
void
AppendEllipseToPath(PathBuilder* aPathBuilder,
const Point& aCenter,
const Size& aDimensions)
{
Size halfDim = aDimensions / 2.0;
Rect rect(aCenter - Point(halfDim.width, halfDim.height), aDimensions);
Size radii[] = { halfDim, halfDim, halfDim, halfDim };
AppendRoundedRectToPath(aPathBuilder, rect, radii);
}
} // namespace gfx
} // namespace mozilla

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

@ -99,6 +99,17 @@ void AppendRoundedRectToPath(PathBuilder* aPathBuilder,
const Size(& aCornerRadii)[4],
bool aDrawClockwise = true);
/**
* Appends a path represending an ellipse to the path being built by
* aPathBuilder.
*
* The ellipse extends aDimensions.width / 2.0 in the horizontal direction
* from aCenter, and aDimensions.height / 2.0 in the vertical direction.
*/
void AppendEllipseToPath(PathBuilder* aPathBuilder,
const Point& aCenter,
const Size& aDimensions);
} // namespace gfx
} // namespace mozilla