Re: Converting points in flipped view
Re: Converting points in flipped view
- Subject: Re: Converting points in flipped view
- From: Brian Webster <email@hidden>
- Date: Mon, 25 Jun 2001 23:22:28 -0500
On Monday, June 25, 2001, at 07:45 PM, cocoa-dev-
email@hidden wrote:
In a subclass of NSView, I have it as a coordinate system going
from -1024
to 1024 on both the x and y axis, is is also flipped.
When I draw to this using numbers between -1024 and 1024, it works just
fine. I am trying to implement dragging, and this is where my
problem is.
Whenever I send this message to convert the point that I got:
mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
it gives me a really large number (like 10729835, or something
like that).
I found this out using NSLog.
I'm curious, what does your NSLog look like? Are you printing
out the coordinates as floating points or integers? (they should
be floats) I tried a basic test, and the code you have gives
the right numbers on my machine, so I'm wondering if it's just
your printing that's buggy.
--
Brian Webster
email@hidden
http://www.owlnet.rice.edu/~bwebster