Make gsk_path_builder_svg_arc_to public

This is useful to port SVG paths using this syntax.
This commit is contained in:
Matthias Clasen 2023-08-21 14:17:49 -04:00
parent d33ed4f9ab
commit 88c0ace644
3 changed files with 31 additions and 10 deletions

View File

@ -1040,6 +1040,25 @@ _sincos (double angle,
#endif
}
/**
* gsk_path_builder_svg_arc_to:
* @self: a `GskPathBuilder`
* @rx: X radius
* @ry: Y radius
* @x_axis_rotation: the rotation of the ellipsis
* @large_arc: whether to add the large arc
* @positive_sweep: whether to sweep in the positive direction
* @x: the X coordinate of the endpoint
* @y: the Y coordinate of the endpoint
*
* Implements arc-to according to the SVG spec.
*
* A convenience function that implements the
* [SVG arc_to](https://www.w3.org/TR/SVG11/paths.html#PathDataEllipticalArcCommands)
* functionality.
*
* Since: 4.14
*/
void
gsk_path_builder_svg_arc_to (GskPathBuilder *self,
float rx,
@ -1072,6 +1091,8 @@ gsk_path_builder_svg_arc_to (GskPathBuilder *self,
double th_half;
double t;
g_return_if_fail (self != NULL);
if (self->points->len > 0)
{
current = &g_array_index (self->points, graphene_point_t, self->points->len - 1);

View File

@ -133,6 +133,16 @@ void gsk_path_builder_rel_arc_to (GskPathBuilder
float x2,
float y2);
GDK_AVAILABLE_IN_4_14
void gsk_path_builder_svg_arc_to (GskPathBuilder *self,
float rx,
float ry,
float x_axis_rotation,
gboolean large_arc,
gboolean positive_sweep,
float x,
float y);
GDK_AVAILABLE_IN_4_14
void gsk_path_builder_close (GskPathBuilder *self);

View File

@ -56,15 +56,5 @@ gboolean gsk_path_foreach_with_tolerance (GskPath
void gsk_path_builder_add_contour (GskPathBuilder *builder,
GskContour *contour);
void gsk_path_builder_svg_arc_to (GskPathBuilder *builder,
float rx,
float ry,
float x_axis_rotation,
gboolean large_arc,
gboolean positive_sweep,
float x,
float y);
G_END_DECLS