Re: NSBezierPath, flipped Glyphs, and NSOutlineView
Re: NSBezierPath, flipped Glyphs, and NSOutlineView
- Subject: Re: NSBezierPath, flipped Glyphs, and NSOutlineView
- From: Scott Thompson <email@hidden>
- Date: Wed, 12 May 2004 07:37:27 -0500
On May 12, 2004, at 5:48 AM, Duncan Oliver wrote:
I've been having a problem with the custom display for my subclass of
NSCell. The subclass draws a box constructed with NSBezierPath and a
glyph made with appendBezierPathWithGlyph:inFont. I have an
NSOutlineView that displays this cell. The problem is that the glyph
is upside-down, and I can't figure out how to flip it around. I've
tried locking the focus to the control view of the cell (the
NSOutlineView), but that doesn't help. Is there another fix for this
problem? Thanks.
You need to flip the coordinate system for your view using something
like:
NSAffineTransform *myTransform = [NSAffineTransform transform];
[transform translateXBy: 0 yBy: cellSize.height];
[transform scaleXBy: 1.0 scaleYBy: -1];
[NSGraphicsContext saveGraphicsState];
[transform concat];
... Draw Glyph here ...
[NSGraphicsContext restoreGraphicsState];
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.