[cairo] Extents of degenerate paths

Behdad Esfahbod behdad at behdad.org
Thu May 10 09:35:48 PDT 2007


Bill, you are more than welcome to come up with a backward-compatible
proposal (like a new hairline mode, no abuse of line-width=0), with
complete semantics of how it should work (for example, what happens if
you draw a line from 0,0 to 0,10?.  After that you need to find someone
to implement it.

Other than that, I don't think raising this issue again and again
changes anything.  Also I don't see any indication in T Rowley's message
that he was trying to achieve hairlines.

behdad

On Thu, 2007-05-10 at 11:38 +0100, Bill Spitzak wrote:
> Yes returning a bounding box of zero is correct for the definition of 
> how Cairo works. The problem is that the original poster wants the same 
> thing I have requested quite a few times:
> 
> Setting the line width to zero should produce a "special" stroke mode 
> which draws very thin but nice-looking lines that hide the antialiasing 
> on the same shape when filled and never have antialiasing if they are 
> horizontal or vertical. It also, I guess, changes the rules for the 
> bounding box so that it does not really surround the pixels that will be 
> drawn, but instead is the bounding box of an infinitesimally thin line.
> 
> Believe me, this is EXTREMELY common, so common that T Rowley just 
> assumed that he should set the line width to zero to get this effect, as 
> though it was second nature. Notice that he purposely set the line 
> width, rather than leaving it at the default value, which reveals this 
> implicit assumption. Every other graphics api I have ever seen that 
> allows the line width to be set has exactly this behavior: zero is a 
> special mode that produces visible lines, often quite different than 
> what you get with 1 or with .000001.
> 
> Behdad Esfahbod wrote:
> > On Wed, 2007-05-09 at 15:20 +0200, David Turner wrote:
> >> On Mon, 07 May 2007 20:07:15 -0400, "Behdad Esfahbod" <behdad at behdad.org> said:
> >>> On Mon, 2007-05-07 at 14:46 -0400, T Rowley wrote:
> >>>> In Mozilla SVG, I've run across the case where the code needs to check 
> >>>> the extents of a single diagonal line.  With stroke_width set to zero I 
> >>>> get back 0,0,0,0 rather than the a tight bounding box for the line.
-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list