I've got a simple test app with a custom view (set up in Interface Builder) with its origin at (20, 20). When I get a mouse event at the lower left most point in the view, the event's location is being reported as (20, 21) and the converted point at (0, 1). I'm using pixie to make sure I'm clicking right at the lower left corner. (If I move one pixel down, I get nothing, indicating I'm outside the view.)
Here's the mouseDown code:
- (void)mouseDown:(NSEvent *)e
{
NSPoint pt = [e locationInWindow];
NSLog(@"Location in Window: %.0f, %.0f", pt.x, pt.y);
pt = [self convertPoint:pt fromView:nil];
NSLog(@"Converted Point: %.0f, %.0f", pt.x, pt.y);
}
Can anyone explain why the y position appears to be off by one?