DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

ken's picture

Unregistered

Feeds

aliases

  • ken

ken

1 year ago

in AcornImage on toxicsoftware.com
Cool beans, but the class hierarchy makes me a bit nervous..

NSCustomImageRep isn't a class you typically subclass - it's a concrete class whose purpose in life is to _delegate_ drawing.

This image rep should be a subclass of NSImageRep. Cool though. :-)

3 years ago

in ‘Discrete’ NSLevelIndicatorCell too slow on toxicsoftware.com
I think I recognize this one..

Try writing a subclass with this as its only implementation:

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
[NSGraphicsContext saveGraphicsState];
NSRectClip(cellFrame);
[super drawWithFrame:cellFrame inView:controlView];
[NSGraphicsContext restoreGraphicsState];
}

The issue is with CG transparency layers (see CGContextBeginTransparencyLayer). They're a nice, clean way to a bunch of drawing, then put a shadow or a focus ring on the whole thing. Problem is, when you composite a transparency layer, it'll do calculations over the whole clip. It happens that when a cell is drawn in a tableview, the only clip is to the whole table.

That's, uh, bad.
Returning? Login