On Mon, May 4, 2009 at 6:19 PM, Steven Degutis <[email protected]> wrote:
> Specifically, you'll notice that the -hitTest: returns the correct
> layer *only* if you click the view while it is fully visible in the
> window, and before you have made it not-fully-visible for the first
> time. After you resize the scroll view to hide any portion of this
> NSView subclass, -hitTest: will consistently return the wrong layer
> every time.
[...]
> - (void) mouseDown:(NSEvent*)event {
> NSPoint point = [self convertPoint:[event locationInWindow]
> fromView:nil];
> CALayer *layer = [self.layer hitTest:NSPointToCGPoint(point)];
> NSLog(@"%@", [layer name]);
> }
>
> I've tried to replace `self` with the enclosing scroll view, or its
> content view or document view, in the -mouseDown: method, and many
> combinations of this. Nothing seems to do the trick.
-hitTest on CALayer, like NSView, takes a point in the superlayer's coordinate
system.
Jim
_______________________________________________
Cocoa-dev mailing list ([email protected])
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 [email protected]