[gtk/wip/matthiasc/lottie-stroke: 48/55] path: Fix winding number for reverse rects




commit 54a480ccf8ad97e27cf637ce9597501453787b82
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 074ea2f42d..5af59aeef2 100644
--- a/gsk/gskcontour.c
+++ b/gsk/gskcontour.c
@@ -476,7 +476,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]