2023-07-08 14:15:22 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "gskpathpoint.h"
|
|
|
|
#include "gskcontourprivate.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2023-08-28 02:17:57 +00:00
|
|
|
#define GSK_PATH_POINT_INIT(c,i,tt) ((GskPathPoint){ .contour=(c), .idx=(i), .t=(tt) })
|
2023-08-27 13:07:00 +00:00
|
|
|
|
2023-08-28 03:12:25 +00:00
|
|
|
static inline gboolean
|
|
|
|
gsk_path_point_valid (const GskPathPoint *point,
|
|
|
|
GskPath *path)
|
|
|
|
{
|
|
|
|
const GskContour *contour;
|
|
|
|
gsize n_ops;
|
|
|
|
|
|
|
|
if (point == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (path == NULL)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (point->contour >= gsk_path_get_n_contours (path))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
contour = gsk_path_get_contour (path, point->contour);
|
|
|
|
n_ops = gsk_contour_get_n_ops (contour);
|
|
|
|
if ((n_ops > 1 && point->idx >= n_ops) ||
|
|
|
|
(n_ops == 1 && point->idx > n_ops))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (point->t < 0 || point->t > 1)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2023-07-08 14:15:22 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|