[gtk/mask-nodes: 1/8] stroke: Fix gsk_stroke_equal
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/mask-nodes: 1/8] stroke: Fix gsk_stroke_equal
- Date: Wed, 16 Dec 2020 05:04:13 +0000 (UTC)
commit 1e1e58c1d3b7df09217807cc58111a193f2bac70
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]