[cairo] [PATCH 0/5] Fix dashing with zero length dash intervals.

Carl Worth cworth at cworth.org
Fri Apr 14 10:15:49 PDT 2006


On Sun, 9 Apr 2006 23:10:36 -0400, Jeff Muizelaar wrote:
>
> The current implementation will render a zero-length visible segment as having
> zero length. However, the ghostscript rasterizer as well as acrobat both render
> these segments as they do zero-width lines -- 1 pixel thick.

Oh, so that's actually a problem.

Now that the zero-length dash stuff has landed I am getting a failure
for the new dash-zero-length test against the PostScript backend. The
claim of the test case is that butt-capped zero-length dash segments
should be invisible.

I like that semantic, as it is consistent with the fact that zero
width stroked lines in cairo are also invisible.

So this new failure is a bug in the PostScript backend since it's not
emitting something invisible.

In the case of zero-width lines, cairo's PostScript should be
consistent with cairo's "invisible" semantics because we catch the 0.0
case early up in cairo_gstate.c and don't draw anything.

So maybe we should do the same thing here, and at a high-level catch
the case of butt-capped dashing and filter out any zero elements in
the dash array. For example, a dash array of:

	[4 0 1]

would be replaced with:

	[5]

when drawing with butt caps, (and should be left alone when drawing
with round or square caps).

What do you think?

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060414/394dcdc1/attachment-0001.pgp


More information about the cairo mailing list