Subject: Re: Mouse event coordinates getting screwed up...

From: [email-masked] (Steve Isaac)
Date: Mon, 26 Oct 87 20:02:00 EST

>I had some problems with screwed up coordinates comeing off a canvas in an
>event process.  I solved it by executing a "setcanvas" EVERY time the
>event process woke up.  It seems that a given process will see the
>"old" graphics state associated w/ a canvas until the process has done
>another 'setcanvas'.

The X|YLocation fields in an event are transformed to the *current canvas'
coordinate system*. So, whatever the current canvas is set to when your event
handler accesses the X|YLocation fields is what determines how these
suckers are reported back.

For instance, if you want to have the coordinates be transformed by the
canvas that the events occurred in, do the following:

	awaitevent
        begin
           Canvas setcanvas
           XLocation ...
	   ...
        end

This is documented in the NeWS manual under the description
of XLocation in the PostScript Type Extensions section. It doesn't
really jump out at you, however...