replace a 10.6-deprecated method

This commit is contained in:
Mitchell Livingston 2009-12-21 23:47:16 +00:00
parent a7245651f2
commit c9a3324684
1 changed files with 6 additions and 4 deletions

View File

@ -66,12 +66,14 @@
if (fIcon)
{
NSSize iconSize = [fIcon size], tabSize = [tabImage size];
NSPoint point = NSMakePoint(floorf((tabSize.width - iconSize.width) * 0.5),
floorf((tabSize.height - iconSize.height) * 0.5));
const NSSize iconSize = [fIcon size], tabSize = [tabImage size];
const NSRect iconRect = NSMakeRect(floor((tabSize.width - iconSize.width) * 0.5),
floor((tabSize.height - iconSize.height) * 0.5),
iconSize.width, iconSize.height);
[tabImage lockFocus];
[fIcon compositeToPoint: point operation: NSCompositeSourceOver];
[fIcon drawInRect: iconRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
[tabImage unlockFocus];
}