diff --git a/gsk/gskpathpoint.c b/gsk/gskpathpoint.c index eef0ecdfc7..a55e879b18 100644 --- a/gsk/gskpathpoint.c +++ b/gsk/gskpathpoint.c @@ -139,8 +139,8 @@ gsk_path_point_compare (const GskPathPoint *point1, /** * gsk_path_point_get_position: - * @path: a `GskPath` - * @point: a `GskPathPoint` on @path + * @point: a `GskPathPoint` + * @path: the path that @point is on * @position: (out caller-allocates): Return location for * the coordinates of the point * @@ -149,15 +149,15 @@ gsk_path_point_compare (const GskPathPoint *point1, * Since: 4.14 */ void -gsk_path_point_get_position (GskPath *path, - const GskPathPoint *point, +gsk_path_point_get_position (const GskPathPoint *point, + GskPath *path, graphene_point_t *position) { GskRealPathPoint *self = (GskRealPathPoint *) point; const GskContour *contour; + g_return_if_fail (self != NULL); g_return_if_fail (path != NULL); - g_return_if_fail (point != NULL); g_return_if_fail (position != NULL); g_return_if_fail (self->contour < gsk_path_get_n_contours (path)); @@ -167,8 +167,8 @@ gsk_path_point_get_position (GskPath *path, /** * gsk_path_point_get_tangent: - * @path: a `GskPath` - * @point: a `GskPathPoint` on @path + * @point: a `GskPathPoint` + * @path: the path that @point is on * @direction: the direction for which to return the tangent * @tangent: (out caller-allocates): Return location for * the tangent at the point @@ -184,16 +184,16 @@ gsk_path_point_get_position (GskPath *path, * Since: 4.14 */ void -gsk_path_point_get_tangent (GskPath *path, - const GskPathPoint *point, +gsk_path_point_get_tangent (const GskPathPoint *point, + GskPath *path, GskPathDirection direction, graphene_vec2_t *tangent) { GskRealPathPoint *self = (GskRealPathPoint *) point; const GskContour *contour; + g_return_if_fail (self != NULL); g_return_if_fail (path != NULL); - g_return_if_fail (point != NULL); g_return_if_fail (tangent != NULL); g_return_if_fail (self->contour < gsk_path_get_n_contours (path)); @@ -203,8 +203,8 @@ gsk_path_point_get_tangent (GskPath *path, /** * gsk_path_point_get_curvature: - * @path: a `GskPath` - * @point: a `GskPathPoint` on @path + * @point: a `GskPathPoint` + * @path: the path that @point is on * @center: (out caller-allocates) (nullable): Return location for * the center of the osculating circle * @@ -220,15 +220,15 @@ gsk_path_point_get_tangent (GskPath *path, * Since: 4.14 */ float -gsk_path_point_get_curvature (GskPath *path, - const GskPathPoint *point, +gsk_path_point_get_curvature (const GskPathPoint *point, + GskPath *path, graphene_point_t *center) { GskRealPathPoint *self = (GskRealPathPoint *) point; const GskContour *contour; + g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (path != NULL, 0); - g_return_val_if_fail (point != NULL, 0); g_return_val_if_fail (self->contour < gsk_path_get_n_contours (path), 0); contour = gsk_path_get_contour (path, self->contour); diff --git a/gsk/gskpathpoint.h b/gsk/gskpathpoint.h index 05f84caf49..4fdacc797e 100644 --- a/gsk/gskpathpoint.h +++ b/gsk/gskpathpoint.h @@ -57,19 +57,19 @@ int gsk_path_point_compare (const GskPathPoint *poin const GskPathPoint *point2); GDK_AVAILABLE_IN_4_14 -void gsk_path_point_get_position (GskPath *path, - const GskPathPoint *point, +void gsk_path_point_get_position (const GskPathPoint *point, + GskPath *path, graphene_point_t *position); GDK_AVAILABLE_IN_4_14 -void gsk_path_point_get_tangent (GskPath *path, - const GskPathPoint *point, +void gsk_path_point_get_tangent (const GskPathPoint *point, + GskPath *path, GskPathDirection direction, graphene_vec2_t *tangent); GDK_AVAILABLE_IN_4_14 -float gsk_path_point_get_curvature (GskPath *path, - const GskPathPoint *point, +float gsk_path_point_get_curvature (const GskPathPoint *point, + GskPath *path, graphene_point_t *center); diff --git a/testsuite/gsk/path-special-cases.c b/testsuite/gsk/path-special-cases.c index da279a83ae..bc83ba9249 100644 --- a/testsuite/gsk/path-special-cases.c +++ b/testsuite/gsk/path-special-cases.c @@ -465,10 +465,10 @@ test_path_point (void) g_assert_true (rp->idx == 2); g_assert_true (rp->t == 1); - gsk_path_point_get_position (path, &point, &pos); - gsk_path_point_get_tangent (path, &point, GSK_PATH_START, &t1); - gsk_path_point_get_tangent (path, &point, GSK_PATH_END, &t2); - curvature = gsk_path_point_get_curvature (path, &point, ¢er); + gsk_path_point_get_position (&point, path, &pos); + gsk_path_point_get_tangent (&point, path, GSK_PATH_START, &t1); + gsk_path_point_get_tangent (&point, path, GSK_PATH_END, &t2); + curvature = gsk_path_point_get_curvature (&point, path, ¢er); g_assert_true (graphene_point_equal (&pos, &GRAPHENE_POINT_INIT (100, 100))); g_assert_true (graphene_vec2_equal (&t1, graphene_vec2_y_axis ()));