[cairo] Coordinate from device to user space without a context

Donn donn.ingle at gmail.com
Fri Nov 8 00:15:09 PST 2013


On 07/11/2013 20:22, Bryce W. Harrington wrote:
> If I were you I'd probably start afresh with just
> the formulas I gave you, and make a little toy app that *just* does the
> mouse -> userspace conversion, without any other matrix calls.

Bryce, I spend some time making a toy app as you suggested. It's giving 
confusing results, but I hope it will help the list help me! Attached.

System info:
valac 0.20.1
cairo114.vapi

On my system I compile it with:
valac --pkg cairo -X -w mailing_list_matrix_testbed.vala -o test
And run:
./test yes #will do the cersion with the formulas
./test #will use device_to_user
then view the output png:
feh img.png

It's confusing because *both* versions do the same wrong thing! I was 
not expecting that. The odd oscillation in the numbers is at work.


> Btw, when you make cr.translate(), cr.rotate(), and cr.scale() calls,
> those are really just helper routines for modifying the internal
> matrix.  So be aware of those too.
Thanks, I will dispense with these calls in favour of a direct 
set_matrix in the future, when I can tell the trees from the woods.


Thanks for all the patience so far, I worry that I'm not comprehending 
fast enough!
\d
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mailing_list_matrix_testbed.vala
Type: text/x-vala
Size: 2409 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20131108/cb2d7c47/attachment.bin>


More information about the cairo mailing list