[gtk/fix-winding: 20/21] path: Fix winding number for reverse rects




commit 411a98c6eb124676d8fa5bff4491343d27a3f65a
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 c7c74e9cff..59de4bb759 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]