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
Jumping coordinates with -convertPoint:fromView:
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Jumping coordinates with -convertPoint:fromView:
Subject
:
Jumping coordinates with -convertPoint:fromView:
From: Jonathan Fewtrell <
email@hidden
>
Date: Wed, 2 Nov 2005 12:28:21 +0000
My app allows a user to drag out a line from A to B. This is done by starting a repeating timer on mouse down and stopping it on mouse up. The start position is recorded at mouse down. The current position is recorded at each subsequent firing of the timer, and a bezier path is drawn from the start point to the current point. Coordinates in the relevant view are found using [theView convertPoint:[theEvent locationInWindow] fromView:nil], where theEvent is the -mouseDown event on mouse down and [NSApp currentEvent] on each firing of the timer. On mouse up, the timer is simply invalidated, and the most recent current point becomes the final point. No new point is recorded using the -mouseUp event.
The problem is that sometimes (not always) on mouse up the final point jumps away from the cursor position. The distance jumped is equal to the offset of the bottom left of the relevant window from the bottom left of the screen. I cannot see why this happens, but I assume it must be an error related to -convertPoint:fromView:. It is particularly odd that it does not always happen, and I have not been able to find any sure way of knowing when it will happen. Can anyone offer any explanation or assistance?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Prev by Date:
CFBundleGetInfoString?
Next by Date:
How to get the Image From QCView
Previous by thread:
Re: CFBundleGetInfoString?
Next by thread:
How to get the Image From QCView
Index(es):
Date
Thread