Re: Canvas View really large?
Re: Canvas View really large?
On 28 Jan 2009, at 08:09, Rick Langschultz wrote:
Hello everyone,
I am developing some drawing software and needed some assistance. I
have a basic view: TSLabel which is just a small plain view that
doesn't really do anything - just a rectangle. This rectangle can be
dragged and moved around it's superview - TSCanvasView which is a
subclass of a TSZoomView.
Here is my code for a mouseDown: event:
NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow]
fromView:nil];
NSLog(@"Mouse Down at X point: %i", mouseLoc.x);
NSLog(@"Mouse Down at Y point: %i", mouseLoc.y);
It won't help that NSPoint.x is declared CGFloat. A %f format
specifier should help.
My results are pretty large actually, here is the results:
2009-01-28 02:02:39.548 TestApp[59739:10b] Mouse Down at X point:
-2089457256
2009-01-28 02:02:39.549 TestApp[59739:10b] Mouse Down at Y point:
-2089602536
I suspect it is because I have the canvas displaying a checkerboard
background that checkerboards the TSCanvasView's drawing.
Can anyone tell me why the X, Y coords are so astronomical? And is
there any code I should look at. Here are my references:
Sketch.app - Apple Developer Tools / Examples
MySQL Workbench
EFLaceView
Any input, or pointers would be greatly appreciated.
Thanks,
Rick Langschultz
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
Jonathan Mitchell
Central Conscious Unit
http://www.mugginsoft.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden