[gtk/mask-nodes: 6/14] stroke: Fix gsk_stroke_equal




commit b0534ff3ae51174bd0082dac2d1a0e0d952dfeda
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 15 19:05:38 2020 -0500

    stroke: Fix gsk_stroke_equal
    
    We need to compare all the fields, of course.

 gsk/gskstroke.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gskstroke.c b/gsk/gskstroke.c
index 60cd3fc6db..654f4255e4 100644
--- a/gsk/gskstroke.c
+++ b/gsk/gskstroke.c
@@ -185,7 +185,25 @@ gsk_stroke_equal (gconstpointer stroke1,
   const GskStroke *self1 = stroke1;
   const GskStroke *self2 = stroke2;
 
-  return self1->line_width == self2->line_width;
+  if (self1->line_width != self2->line_width ||
+      self1->line_cap != self2->line_cap ||
+      self1->line_join != self2->line_join ||
+      self1->miter_limit != self2->miter_limit)
+    return FALSE;
+
+  if (self1->n_dash != self2->n_dash)
+    return FALSE;
+
+  for (int i = 0; i < self1->n_dash; i++)
+    {
+      if (self1->dash[i] != self2->dash[i])
+        return FALSE;
+    }
+
+  if (self1->dash_offset != self2->dash_offset)
+    return FALSE;
+
+  return TRUE;
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]