Re: Mouse position from NSEvent starts at (0, 1) ?
Re: Mouse position from NSEvent starts at (0, 1) ?
- Subject: Re: Mouse position from NSEvent starts at (0, 1) ?
- From: "Joshua Pennington" <email@hidden>
- Date: Fri, 18 May 2007 15:10:31 -0500
I took a look at your code.
When drawing the cross, if you create a path instead of drawing rects,
the cross is properly aligned. Like so:
NSBezierPath *cross = [NSBezierPath bezierPath];
NSPoint startVerticalLine = {x, y - 100};
NSPoint endVerticalLine = {x, y + 100};
[cross moveToPoint:startVerticalLine];
[cross lineToPoint:endVerticalLine];
NSPoint startHorizontalLine = {x - 100, y};
NSPoint endHorizontalLine = {x + 100, y};
[cross moveToPoint:startHorizontalLine];
[cross lineToPoint:endHorizontalLine];
[cross stroke];
On 5/18/07, Mathieu Coursolle <email@hidden> wrote:
The crosshair's hot point is defined as the intersection of the cross,
but my drawing
is offset by one pixel in the Y direction.
My application is available at:
www.rogue-research.com/vtk/TestCursor.zip
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden