[prev in list] [next in list] [prev in thread] [next in thread]
List: cairo
Subject: Re: [cairo] Line widths and coordinate system transformations
From: Simon Budig <simon () budig ! de>
Date: 2008-06-05 13:27:41
Message-ID: 20080605132741.GA10533 () budig ! de
[Download RAW message or body]
Holger Berndt (berndth@gmx.de) wrote:
> I am aware that I could achieve that by using the same scale in x and y
> direction. However, that would make drawing much harder, as I would
> have to do the transformations for each point individually and
> manually, which is something that I'd really, really like to avoid.
>
> In particular, this very same effect seems to imply that it is not
> possible to draw an ellipse outline with constant line width with
> Cairo. Is that correct?
No, You can change the transformation between the path-creating commands
and the cairo_stroke(). That way the geometry of the pen for the stroke
can be changed without changing its placement. We do this in gimp to
achieve constant-width strokes even in images with different X- and
Y-DPI (and a stroke width specified in a real-world-unit).
Getting it right might need a bit fiddeling, but if you want to have
pixel based measurement cairo_device_to_user_distance() comes in handy
at that point.
I hope this helps,
Simon
--
simon@budig.de http://simon.budig.de/
_______________________________________________
cairo mailing list
cairo@cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic