Re: mouseDown Event Position Accuracy (was: NSString drawAtPoint and vertical font alignment)

2009-09-07 Thread Stephen Blinkhorn
Astonishing... that is the problem. I thought the default hot spot for the default cursor would be the tip of the arrow. Obviously not. OK, custom cursors it is then. Many thanks, Stephen On 7 Sep 2009, at 10:24, Steven Degutis wrote: Stephen, The most obvious reason that comes to mind

Re: mouseDown Event Position Accuracy (was: NSString drawAtPoint and vertical font alignment)

2009-09-07 Thread Steven Degutis
Stephen, The most obvious reason that comes to mind, is that your cursor's exact point is not located on the exact top of the default +[NSCursor arrowCursor]. It's actually located a little lower. Try changing your cursor to the crosshair cursor, or a custom cursor if you'd prefer, and see if it i

mouseDown Event Position Accuracy (was: NSString drawAtPoint and vertical font alignment)

2009-09-07 Thread Stephen Blinkhorn
On 7 Sep 2009, at 01:09, Quincey Morris wrote: On Sep 6, 2009, at 23:38, Stephen Blinkhorn wrote: I make a custom view (really a NSControl subclass) and I use a place holder in IB to position it on screen. I also set it's size to be say 50 wide by 22 high. If I draw the view by simply f

Re: NSString drawAtPoint and vertical font alignment

2009-09-07 Thread Quincey Morris
On Sep 6, 2009, at 23:38, Stephen Blinkhorn wrote: I make a custom view (really a NSControl subclass) and I use a place holder in IB to position it on screen. I also set it's size to be say 50 wide by 22 high. If I draw the view by simply filling the rect returned by [self bounds] then i

Re: NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Stephen Blinkhorn
On 6 Sep 2009, at 21:30, Quincey Morris wrote: On Sep 6, 2009, at 18:41, Stephen Blinkhorn wrote: OK, do you mean the origin of [self bounds] isn't always (0, 0)? That could explain a few things.. The origin of the bounds coordinate system is always (0, 0) by definition, but what I mean

Re: NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Quincey Morris
On Sep 6, 2009, at 18:41, Stephen Blinkhorn wrote: OK, do you mean the origin of [self bounds] isn't always (0, 0)? That could explain a few things.. The origin of the bounds coordinate system is always (0, 0) by definition, but what I meant to say was that the bottom left corner of the

Re: NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Stephen Blinkhorn
On 6 Sep 2009, at 18:37, Quincey Morris wrote: There are several things wrong with this: -- You're not accounting for the bounds origin, so it only works if the origin happens to be (0, 0). OK, do you mean the origin of [self bounds] isn't always (0, 0)? That could explain a few things.

Re: NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Quincey Morris
On Sep 6, 2009, at 17:11, Stephen Blinkhorn wrote: I would have thought that the code below will center text horizontally and vertically within a NSRect. Sometimes it does but it depends on the font I am using. So the below may work for Verdana but if I change to Helvetica then the vertic

NSString drawAtPoint and vertical font alignment

2009-09-06 Thread Stephen Blinkhorn
Hi all, I would have thought that the code below will center text horizontally and vertically within a NSRect. Sometimes it does but it depends on the font I am using. So the below may work for Verdana but if I change to Helvetica then the vertical centering is off. Is there a better wa