mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
Merge branch 'matthiasc/for-main' into 'main'
Rename an internal function See merge request GNOME/gtk!6301
This commit is contained in:
commit
08c064d79a
@ -61,7 +61,7 @@ struct _GskContourClass
|
||||
GskContour * (* reverse) (const GskContour *contour);
|
||||
int (* get_winding) (const GskContour *contour,
|
||||
const graphene_point_t *point);
|
||||
gsize (* get_n_points) (const GskContour *contour);
|
||||
gsize (* get_n_ops) (const GskContour *contour);
|
||||
gboolean (* get_closest_point) (const GskContour *contour,
|
||||
const graphene_point_t *point,
|
||||
float threshold,
|
||||
@ -410,7 +410,7 @@ gsk_standard_contour_get_winding (const GskContour *contour,
|
||||
}
|
||||
|
||||
static gsize
|
||||
gsk_standard_contour_get_n_points (const GskContour *contour)
|
||||
gsk_standard_contour_get_n_ops (const GskContour *contour)
|
||||
{
|
||||
GskStandardContour *self = (GskStandardContour *) contour;
|
||||
|
||||
@ -592,6 +592,8 @@ gsk_standard_contour_add_segment (const GskContour *contour,
|
||||
GskStandardContour *self = (GskStandardContour *) contour;
|
||||
GskCurve c, c1, c2;
|
||||
|
||||
g_assert (start->idx < self->n_ops);
|
||||
|
||||
gsk_curve_init (&c, self->ops[start->idx]);
|
||||
|
||||
if (start->idx == end->idx)
|
||||
@ -645,7 +647,7 @@ static const GskContourClass GSK_STANDARD_CONTOUR_CLASS =
|
||||
gsk_standard_contour_foreach,
|
||||
gsk_standard_contour_reverse,
|
||||
gsk_standard_contour_get_winding,
|
||||
gsk_standard_contour_get_n_points,
|
||||
gsk_standard_contour_get_n_ops,
|
||||
gsk_standard_contour_get_closest_point,
|
||||
gsk_standard_contour_get_position,
|
||||
gsk_standard_contour_get_tangent,
|
||||
@ -798,9 +800,9 @@ gsk_contour_get_closest_point (const GskContour *self,
|
||||
}
|
||||
|
||||
gsize
|
||||
gsk_contour_get_n_points (const GskContour *self)
|
||||
gsk_contour_get_n_ops (const GskContour *self)
|
||||
{
|
||||
return self->klass->get_n_points (self);
|
||||
return self->klass->get_n_ops (self);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -57,7 +57,7 @@ void gsk_contour_get_start_end (const GskContou
|
||||
graphene_point_t *end);
|
||||
int gsk_contour_get_winding (const GskContour *self,
|
||||
const graphene_point_t *point);
|
||||
gsize gsk_contour_get_n_points (const GskContour *self);
|
||||
gsize gsk_contour_get_n_ops (const GskContour *self);
|
||||
gboolean gsk_contour_get_closest_point (const GskContour *self,
|
||||
const graphene_point_t *point,
|
||||
float threshold,
|
||||
|
@ -559,7 +559,7 @@ gsk_path_get_end_point (GskPath *self,
|
||||
return FALSE;
|
||||
|
||||
res->contour = self->n_contours - 1;
|
||||
res->idx = gsk_contour_get_n_points (self->contours[self->n_contours - 1]) - 1;
|
||||
res->idx = gsk_contour_get_n_ops (self->contours[self->n_contours - 1]) - 1;
|
||||
res->t = 1;
|
||||
|
||||
return TRUE;
|
||||
|
@ -1115,6 +1115,7 @@ gsk_path_builder_add_segment (GskPathBuilder *self,
|
||||
const GskContour *contour;
|
||||
gsize n_contours = gsk_path_get_n_contours (path);
|
||||
graphene_point_t current;
|
||||
gsize n_ops;
|
||||
|
||||
g_return_if_fail (self != NULL);
|
||||
g_return_if_fail (path != NULL);
|
||||
@ -1126,6 +1127,7 @@ gsk_path_builder_add_segment (GskPathBuilder *self,
|
||||
current = self->current_point;
|
||||
|
||||
contour = gsk_path_get_contour (path, s->contour);
|
||||
n_ops = gsk_contour_get_n_ops (contour);
|
||||
|
||||
if (s->contour == e->contour)
|
||||
{
|
||||
@ -1136,25 +1138,30 @@ gsk_path_builder_add_segment (GskPathBuilder *self,
|
||||
}
|
||||
else if (n_contours == 1)
|
||||
{
|
||||
if (n_ops > 1)
|
||||
gsk_contour_add_segment (contour, self, TRUE,
|
||||
s,
|
||||
&(GskRealPathPoint) { s->contour, gsk_contour_get_n_points (contour) - 1, 1 });
|
||||
gsk_contour_add_segment (contour, self, FALSE,
|
||||
&(GskRealPathPoint) { s->contour, n_ops - 1, 1 });
|
||||
gsk_contour_add_segment (contour, self, n_ops <= 1,
|
||||
&(GskRealPathPoint) { s->contour, 1, 0 },
|
||||
e);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (n_ops > 1)
|
||||
gsk_contour_add_segment (contour, self, TRUE,
|
||||
s,
|
||||
&(GskRealPathPoint) { s->contour, gsk_contour_get_n_points (contour) - 1, 1 });
|
||||
&(GskRealPathPoint) { s->contour, n_ops - 1, 1. });
|
||||
|
||||
for (gsize i = (s->contour + 1) % n_contours; i != e->contour; i = (i + 1) % n_contours)
|
||||
gsk_path_builder_add_contour (self, gsk_contour_dup (gsk_path_get_contour (path, i)));
|
||||
|
||||
contour = gsk_path_get_contour (path, e->contour);
|
||||
gsk_contour_add_segment (contour, self, FALSE,
|
||||
n_ops = gsk_contour_get_n_ops (contour);
|
||||
|
||||
if (n_ops > 1)
|
||||
gsk_contour_add_segment (contour, self, TRUE,
|
||||
&(GskRealPathPoint) { e->contour, 1, 0 },
|
||||
e);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user