mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 931996 - Add an AppendEllipseToPath helper to Moz2D. r=Bas
--HG-- extra : rebase_source : 75592379b93e5574ff1bb4116ce8b90b62c4f8a1
This commit is contained in:
parent
8131d3fc10
commit
dbd6cf47e7
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user