curve: Add gsk_curve_get_normal

Its easy but thats no reason not to have this api.
This commit is contained in:
Matthias Clasen
2020-12-23 13:36:19 -05:00
parent 8258550df9
commit 73a06b6b2a
2 changed files with 16 additions and 0 deletions

View File

@@ -1625,6 +1625,19 @@ gsk_curve_get_tangent (const GskCurve *curve,
get_class (curve->op)->get_tangent (curve, progress, tangent);
}
void
gsk_curve_get_normal (const GskCurve *curve,
float t,
graphene_vec2_t *normal)
{
graphene_vec2_t tangent;
gsk_curve_get_tangent (curve, t, &tangent);
graphene_vec2_init (normal,
- graphene_vec2_get_y (&tangent),
graphene_vec2_get_x (&tangent));
}
void
gsk_curve_split (const GskCurve *curve,
float progress,

View File

@@ -123,6 +123,9 @@ void gsk_curve_get_point (const GskCurve
void gsk_curve_get_tangent (const GskCurve *curve,
float progress,
graphene_vec2_t *tangent);
void gsk_curve_get_normal (const GskCurve *curve,
float progress,
graphene_vec2_t *normal);
void gsk_curve_split (const GskCurve *curve,
float progress,
GskCurve *start,