Path: utzoo!attcan!cmtl01!matrox!uvm-gen!uunet!lll-winken!lll-lcc!ncis.llnl.gov!helios.ee.lbl.gov!nosc!ucsd!ucbvax!BRILLIG.UMD.EDU!don From: don@BRILLIG.UMD.EDU (Don Hopkins) Newsgroups: comp.windows.news Subject: Is "transform" in NeWS 1.1 OK ? Message-ID: <8901260111.AA23398@brillig.umd.edu> Date: 26 Jan 89 01:12:27 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 23 The reason transform is giving unexpected results is that it takes into account the height of the canvas you're on, flipping the y-coordinate to pixrect "device" coordinates. The pixrect origin is the upper left corner, while the default NeWS origin is the lower left. This is a pain, and probably the reason why the matrix args to transform, scale, etc, are not implemented. A transformation matrix for one canvas will not work the same on a another canvas of a different height, because there is this implicit transformation and y scale flip. I've recently run into a bug with setting the /XLocation and /YLocation fields of events. When I am on a canvas other than the frame buffer, and I set them to some value, then immediatly read them back, THEY'RE DIFFERENT!! To correctly set the event coordinates to a position relative to my canvas, I have to setcanvas to the frame buffer, manually subtract my canvas's offset from the lower left corner of the framebuffer from my coordinates, and THEN def the /XLocation and /YLocation fields. I think my problem is also related to the pixrect origin -vs- PostScript origin problem. Pixrects are *EVIL*. -Don