mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
Bug 931996 - Add an AppendEllipseToPath helper to Moz2D. r=Bas
This commit is contained in:
parent
9f49af5ab7
commit
caaba68678
@ -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
|
||||
|
||||
|
@ -98,6 +98,17 @@ GFX2D_API 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.
|
||||
*/
|
||||
GFX2D_API void AppendEllipseToPath(PathBuilder* aPathBuilder,
|
||||
const Point& aCenter,
|
||||
const Size& aDimensions);
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mozilla
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user