|
WebHTMLView subclass simply calling super's drawRect: method.
The "done" button renders incorrectly, but that's another problem.
|
With the intervening code in drawRect: to darken the image.
Notice how the textual part of the popup buttons look like they've shifted down. They are actually being drawn flipped.
NSImage *clipImage = [[NSImage alloc]
initWithSize:[self bounds].size];
[clipImage lockFocus];
[super drawRect:rect];
// darken the image to indicate selection
[[[NSColor blackColor]
colorWithAlphaComponent:.5] set];
NSRectFillUsingOperation(
rect, NSCompositeSourceAtop);
[clipImage unlockFocus];
[clipImage drawInRect:rect fromRect:rect
operation:NSCompositeSourceOver
fraction:1.0];
[clipImage release];
|
What the view looks like if I add
[clipImage setFlipped:YES]
before locking focus on it. The popup buttons render correctly, but the whole image is flipped.
|