summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2011-03-08 10:26:06 +0100
committerAndrea Canciani <ranma42@gmail.com>2011-03-19 15:53:39 +0100
commit36e0cad71aa7b9a84fb31fba333175cbf445ab4e (patch)
tree97fe759b798902fb9eb1780e793f7034cc4f6d84
parent145e8ab03db77a13b49bfb0fb9ca6355ad48c2bc (diff)
path: Fix _cairo_path_fixed_is_rectangle()
__cairo_path_fixed_is_rectangle() is used by the PS and PDF backends to check if a path is equivalent to a rectangle when stroking. This is different from being a rectangle when filling, because of the implicit close_path appended to every subpath when filling. Fixes stroke-open-box. See https://bugs.freedesktop.org/show_bug.cgi?id=34560
-rw-r--r--src/cairo-path-fixed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index eea8630bd..72af7bb4c 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -1286,8 +1286,11 @@ _cairo_path_fixed_is_rectangle (const cairo_path_fixed_t *path,
if (! _cairo_path_fixed_is_box (path, box))
return FALSE;
+ /* This check is valid because the current implementation of
+ * _cairo_path_fixed_is_box () only accepts rectangles like:
+ * move,line,line,line[,line|close[,close|move]]. */
buf = cairo_path_head (path);
- if (buf->points[0].y == buf->points[1].y)
+ if (buf->num_ops > 4)
return TRUE;
return FALSE;