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
This commit is contained in:
Andrea Canciani 2011-03-08 10:26:06 +01:00
parent 4369255961
commit c0fe556515

View file

@ -1290,8 +1290,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;