Re: Change the coordinate system for drawing

Stefan Salewski <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Thu, 2011-10-20 at 23:02 -0300, craf wrote:
> [...]
> 
> As I understand it, the point (0,0) is located in the upper left of the
> control gtk.drawinarea.
> 

You may use cairo's scale and translate methods to change the origin,
with code like 

>cr.translate(0, @darea.allocation.height) # horizontally mirror our
>display to be compatible with gEDA/gschem 
>cr.scale(1, -1)

I did that when playing with a simple drawing application.
(http://www.ssalewski.de/PetEd.html.en)
Some more code was necessary to get zooming, scrolling and mouse user
input working. Of course there may exists much better solutions.


--
cairo mailing list
[email protected]
http://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.