[cairo] Antialiasing and round, bevelled widgets (was: Cairo developers conference call...)

Bill Spitzak spitzak at d2.com
Tue Oct 19 10:26:57 PDT 2004

On Tuesday 19 October 2004 09:57 am, Jon Smirl wrote:

> Won't apps that fix this by adding 0.5 pixel look wrong when drawn at
> a larger scale?

Not really, because the line width will also scale up. If the graphic was 
drawn at infinite precision the top/left edge of the stroke would exactly 
coincide with the top/left edge of the fill drawn on integers.

However in reality at a non-integer scale, the antialiased edge of a filled 
shape and the antialiased edge of the scaled stroke will end up atop each 
other, and thus the filled shape will leak through slightly in the outermost 
pixel. This may indicate that it is necessary to allow the line width to be 
rounded up and recentered to land on integers somehow.

Also I want to change my proposal, I realize now why it was confusing and 
Carl asked about bottom+right edges. There should be no built-in offset, 
instead the output when compared with normal stroke becomes identical at 
infinite resolution. It would instead round up the line thickness to the 
nearest pixel, and round the path to the nearest integer or integer+.5 
depending on whether the line thickness is even or odd. Ambiguous rounding 
cases should always go right/down.

More information about the cairo mailing list