Add gsk_curve_get_normal
Its easy but thats no reason not to have this api.
This commit is contained in:
@@ -430,6 +430,19 @@ gsk_curve_curve_get_tangent (const GskCurve *curve,
|
||||
graphene_vec2_normalize (tangent, 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));
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_curve_curve_split (const GskCurve *curve,
|
||||
float progress,
|
||||
|
||||
@@ -96,6 +96,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,
|
||||
|
||||
Reference in New Issue
Block a user