[cairo] Zero length segment and SVG

Carl Worth cworth at cworth.org
Tue Jun 27 06:36:03 PDT 2006


On Sun, 25 Jun 2006 16:31:42 -0400, Jeff Muizelaar wrote:
> I think it would be good to add or modify an exisiting testcase to
> exercise the closed-dashed-path-missing-leading-cap bug that Keith Wells
> reported in the "cairo stroke problem with potential patch" thread.

OK, so there are still some things to look into, but I don't think we
need to make this patch block on that first.

> I'd also like to look into the behaviour of degenerate dashed
> sub-paths to make sure we have consistent behaviour.

I ran through things a bit as I wrote the documentation and I feel
pretty good about the ways things are. We've got the test case you
provided for deliberate degenerate paths, and I did a bit more
interactive testing of zero-length dash segments (both round and
square) via cairo-demo/X11/cairo-spline. Everything I've seen so far
seems to be matching the documented semantics just fine, (except for
the failures in the new test case of course).

> diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
> index ced69e2..8100e78 100644
> --- a/src/cairo-ps-surface.c
> +++ b/src/cairo-ps-surface.c
> @@ -1336,6 +1336,12 @@ _string_array_stream_write (cairo_output
>  	    stream->column++;
>  	    stream->string_size++;
>  	    break;
> +	case '~':
> +	    _cairo_output_stream_write (stream->output, &c, 1);
> +	    stream->column++;
> +	    stream->string_size++;
> +	    c = *data++;
> +	    break;
>  	}
>  	_cairo_output_stream_write (stream->output, &c, 1);
>  	stream->column++;

Looks good enough for me for now. Thanks.

So I'm going to commit this little fix then merge the zero-length
branch.

Feel free to fix this string_array stuff up in a slightly cleaner way
later if you'd like to.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060627/354e1957/attachment.pgp


More information about the cairo mailing list