• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
<no subject>
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

<no subject>


  • Subject: <no subject>
  • From: "Joshua D. Orr" <email@hidden>
  • Date: Mon, 25 Jun 2001 12:40:56 -0600

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.

But this method appears to convert that number some how:

[self mouse:mouseLoc inRect:[curObj asRect]]

The [curObj asRect] message returns a rectangle within the -1024 to 1024
(both x and y axis's) range, and it seems to detect when the mouseLoc is in
the rectangle without difficulty even though the mouseLoc is way bigger
number.

I need to be able to convert the mouseLoc point to the same coordinate
system the objects use. Is there some function, method, etc. that I can
use?

Can anybody help me?


-Joshua D. Orr-


  • Prev by Date: Re: *?
  • Next by Date: Re: Plugin Interface
  • Previous by thread: Re: Problem with NSBorderlessWindowMask window
  • Next by thread: Found the problem...
  • Index(es):
    • Date
    • Thread