Re: Using selectedMenuItemColor
Re: Using selectedMenuItemColor
- Subject: Re: Using selectedMenuItemColor
- From: Graham Cox <email@hidden>
- Date: Mon, 11 Apr 2011 12:09:33 +1000
On 11/04/2011, at 11:33 AM, Eric Gorr wrote:
> Hummm...I can't seem to get it to do much. If I alter the code to:
Have you tried using NSAffineTransform to offset the coordinate system to where you want to draw? You probably don't need or want to mess with your view coordinates or frame, you just need to move the coordinate system around within the view using the CTM.
e.g. if you want to highlight the rect <hr> (typed into mail, untested):
NSRect hr = NSMakeRect( 100, 100, 200, 120 );
[NSGraphicsContext saveGraphicsState];
NSAffineTransform* tfm = [NSAffineTransform transform];
[tfm translateXBy:hr.origin.x yBy:hr.origin.y];
[tfm concat];
hr.origin = NSZeroPoint;
NSRectFill( hr );
[NSGraphicsContext restoreGraphicsState];
So you offset to the rect origin, then draw at 0,0.
--Graham
_______________________________________________
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