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

Guillermo Rodriguez <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CABDcavYdG=3=srJGAn+s6v=aUyD_7ieHs02ZdBK_LDs43ZEUfw@mail.gmail.com>
2017-05-17 11:24 GMT+02:00 Lawrence D'Oliveiro <[email protected]>:
> On Wed, 17 May 2017 10:47:46 +0200, Guillermo Rodriguez wrote:
>
>> This simpler explanation fails to explain why this "problem"
>> occurs ...
>
> It occurs because of anti-aliasing.

No. It occurs because integer coordinates map to points half way
between sample point locations, as the original text adequately
explains.

>
>> ... and what is the rationale behind the current design.
>
> You want me to include a rationale for anti-aliasing?

I don't want you to do anything. The original text explains perfectly
why the design is like it is ("[...] so that fills align nicely, at
the cost that some strokes do not").

>
>> It also fails to discuss alternatives such as adjusting endpoints by
>> 0.5, which allows you to get sharp, single-pixel-wide lines without
>> turning off antialiasing, which in many cases is undesirable.
>
> Let me refresh your memory about the question in the FAQ:

Not needed.

>
>     Question: Whenever I try drawing with a line-width of 1.0, my
>     horizontal/vertical lines come out fat and blurry (eg. 2 pixels
>     wide and half-intensity). What's wrong?
>
> Note that it only discusses “horizontal/vertical” lines. This is the
> specific situation where turning off antialiasing is the simplest
> solution.

It may be the simplest, but it is not the only one, and in many cases
not the best one either. The solution proposed in the original text
also solves the problem without the need to turn off antialiasing.

Guillermo
-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.