Re: Cairo drawing



Op di, 10-01-2006 te 15:25 +0000, schreef Duncan Coutts:
> This problem is actually a cairo FAQ:
> 
>         "Why does my 1-pixel wide horizontal/vertical line come out fat
>         and blurry (eg. 2 pixels wide and half-intensity)?"
> 
> You can see the full answer here:
> 
> http://www.cairographics.org/FAQ
I see. Setting the line width to 2 works as expected, but that is too
thick of course. Adding .5 to every coordinate smears it slightly less
but doesn't quite fix it, though.

I'm not sure I quite understand it right. What I'm thinking now is that
y-coordinate 0 is actually the top-most edge, 'height' (in pixels) + 1
is the bottom-most edge. So x and y coordinates fall at the edges
between pixels, and an xy-coordinate at a pixel corner?

> Suffice to say that it's fixable and just comes from not fully
> understanding the cairo drawing model (which is not particularly obvious
> at first).
Indeed. I found alot of documentation, but not that detail. :)

> As for not including the cairo drawing code because of some users who
> don't have cairo yet; is it not possible with python to test at runtime
> if a particular python module/package is available? In which case we
> could test if cairo is available and fallback to the gdk drawing if it's
> not.
It is I suppose, not a bad idea! I'll see if I can fix up a patch for
that.

-- Stéphan

Attachment: signature.asc
Description: Dit berichtdeel is digitaal ondertekend



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]