[cairo] How does one Normailze the Mouse Coordinates to the DrawingArea Box? [ Got it ]
Allen
allen.saucier at cas-inc.com
Mon Jul 2 08:18:27 PDT 2007
Hey all,
I just answered my own questions while playing around w/the
user_to_device() space method. Boy, this is cool.
Anywhere we can post code so that others may learn from our
discoveries? & Have folks on the list notified of those new discoveries?
Allen wrote:
> Hi all,
>
> does anyone know how to normalize the mouse coordinates to be between
> 0.0 ~ 1.0 within a particular DrawingArea?
>
> I've just learned how to use the "scale" method for a cairo context but
> my mouse positions are coming in as Pixel positions and I've No idea how
> to tell if those positions are w/in the Drawing Area let alone how to
> normalize them to ONLY the drawing area.
>
> Thank you for the help ahead of time!
>
> --Allen
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
>
More information about the cairo
mailing list