[cairo] Interpretation of zero-length segments

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 5 01:15:54 PDT 2010


On Thu, 5 Aug 2010 00:54:41 +0200, Krzysztof Kosiński <tweenk.pl at gmail.com> wrote:
> Hello
> 
> Cairo interpretation of zero-length segments appears to differ from
> the SVG interpretation.
> 
> In SVG, a zero-length segment between two normal segments causes the
> stroke to appear like there was a very short linear segment whose

And what length is "very short"? That sounds like a capping issue. A
degenerate path segment should still be capped if the normal is known.

> direction is determined by tangents at the end of the non-degenerate
> segments. In Cairo, zero-length segments are a no-op and the path
> looks like the zero-length segments don't exist at all. This causes
> problems when rendering zero-width or zero-height rectangles, as shown
> in the attachments in the next message (I'm not sure whether it will
> go through).

Hmm, this sounds like a bug in our handling of degenerate closed paths. The
stroke of such a rectangle has a non-zero width, yet the shape of the joins
as the width/height tends to zero is eluding me.

The easiest way to demonstrate this would be to draw rectangles from -4x-4
to 4x4 (including 0x0) for each of the line join modes and then we can
argue about what the semantics for 0x0 should be...
-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list