Re: NSBezierPath, flipped Glyphs, and NSOutlineView
Re: NSBezierPath, flipped Glyphs, and NSOutlineView
- Subject: Re: NSBezierPath, flipped Glyphs, and NSOutlineView
- From: Duncan Oliver <email@hidden>
- Date: Wed, 12 May 2004 08:22:00 -0500
Thanks. I knew I had to take into account the different coordinate
system, but I couldn't figure out how to flip it with
NSAffineTransform. Thanks.
On May 12, 2004, at 7:37 AM, Scott Thompson wrote:
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.
Duncan Oliver
email@hidden
_______________________________________________
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.