[cairo] PATCH cairo-www: Simpler explanation for how to get sharp, single-pixel-wide lines

Guillermo Rodriguez guillerodriguez.dev at gmail.com
Wed May 17 11:27:10 UTC 2017


2017-05-17 12:50 GMT+02:00 Lawrence D'Oliveiro <ldo at geek-central.gen.nz>:
> On Wed, 17 May 2017 12:29:15 +0200, Guillermo Rodriguez wrote:
>
>> It occurs because integer coordinates map to points half way
>> between sample point locations ...
>
> That’s a common misconception.

It's taken straight from the current Cairo FAQ.

Again: A common use case is that you want to have antialiasing in
general BUT at the same time be able to draw 1 pixel wide vertical or
horizontal lines that don't look "blurry". The current text describes
an approach which achieves exactly that by adjusting endpoints of
horizontal / vertical lines by 0.5 in the appropriate direction. That
gets you perfect sharp, single-pixel-wide vertical and horizontal
lines without the need to turn off antialiasing. Your "simpler
explanation" proposal misses that completely.

Guillermo


More information about the cairo mailing list