[gtk/fix-winding: 1/2] path: Fix winding number for reverse rects
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/fix-winding: 1/2] path: Fix winding number for reverse rects
- Date: Mon, 7 Dec 2020 01:14:38 +0000 (UTC)
commit 17d3ef293530d8d8b9f19ab018245ed79c4cbb9c
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Dec 6 20:00:52 2020 -0500
path: Fix winding number for reverse rects
We need to return -1 or 1, depending on whether we
go clockwise or counterclockwise.
gsk/gskcontour.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gskcontour.c b/gsk/gskcontour.c
index 1d09d1f380..aa44f09671 100644
--- a/gsk/gskcontour.c
+++ b/gsk/gskcontour.c
@@ -464,7 +464,12 @@ gsk_rect_contour_get_winding (const GskContour *contour,
graphene_rect_init (&rect, self->x, self->y, self->width, self->height);
if (graphene_rect_contains_point (&rect, point))
- return -1;
+ {
+ if ((self->width > 0) != (self->height > 0))
+ return 1;
+ else
+ return -1;
+ }
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]