On Sep 13, 2011, at 12:49 PM, Martin Hewitson wrote:
> So this almost provides the answer. I made a subclass and in there override 
> setRotationAngle:centerPoint: but this triggers for every mouse movement, 
> rather than for an accumulated drag from the user. I then tried to override 
> mouseUp with the plan to set a flag didRotate in 
> setRotationAngle:centerPoint: and then send a delegate message or 
> notification on mouseUp, then reset the flag. Unfortunately IKImageView 
> doesn't receive a mouseUp: when rotating. This works for moving the image, 
> but not rotating. So I guess for now I will try to live with the many 
> messages to the delegate, but I would have liked to quantise this at the 
> level of the user's action, so bracketed by mouseDown: and mouseUp:. If 
> anyone has any ideas how this might be achieved, I'd be happy to hear them.

Sounds like mouseDown: implements its own drag loop when it detects that you're 
rotating the image. Test: if you override mouseDown: and do an NSLog, followed 
by super, followed by another NSLog, when does the second NSLog get called? 
Right way, or at the end of your drag?

If this theory is correct, you can set a flag in setRotationAngle:centerPoint: 
that says "the image was rotated" and check for that flag in mouseDown:. You 
might also need a flag in mouseDown: that says "the mouse is down, so 
henceforth any rotation of the image should be noted." Something like that.

--Andy

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to