Revision: 5882
http://skim-app.svn.sourceforge.net/skim-app/?rev=5882&view=rev
Author: hofman
Date: 2009-10-14 20:50:45 +0000 (Wed, 14 Oct 2009)
Log Message:
-----------
avoid creating an extra image
Modified Paths:
--------------
trunk/SKBookmark.m
Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m 2009-10-14 20:44:54 UTC (rev 5881)
+++ trunk/SKBookmark.m 2009-10-14 20:50:45 UTC (rev 5882)
@@ -286,20 +286,17 @@
image = [[NSImage alloc] initWithSize:NSMakeSize(32.0, 32.0)];
NSImage *genericDocImage = [[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kGenericDocumentIcon)];
NSImage *questionMark = [[NSWorkspace sharedWorkspace]
iconForFileType:NSFileTypeForHFSTypeCode(kQuestionMarkIcon)];
- NSImage *tmpImage = [[NSImage alloc] initWithSize:NSMakeSize(32.0,
32.0)];
- [tmpImage lockFocus];
+ [image lockFocus];
[genericDocImage drawInRect:NSMakeRect(0.0, 0.0, 32.0, 32.0)
fromRect:NSZeroRect operation:NSCompositeCopy fraction:0.7];
[questionMark drawInRect:NSMakeRect(6.0, 4.0, 20.0, 20.0)
fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:0.7];
- [tmpImage unlockFocus];
- [image addRepresentation:[[tmpImage representations] lastObject]];
- [tmpImage release];
- tmpImage = [[NSImage alloc] initWithSize:NSMakeSize(16.0, 16.0)];
- [tmpImage lockFocus];
+ [image unlockFocus];
+ NSImage *tinyImage = [[NSImage alloc] initWithSize:NSMakeSize(16.0,
16.0)];
+ [tinyImage lockFocus];
[genericDocImage drawInRect:NSMakeRect(0.0, 0.0, 16.0, 16.0)
fromRect:NSZeroRect operation:NSCompositeCopy fraction:0.7];
[questionMark drawInRect:NSMakeRect(3.0, 2.0, 10.0, 10.0)
fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:0.7];
- [tmpImage unlockFocus];
- [image addRepresentation:[[tmpImage representations] lastObject]];
- [tmpImage release];
+ [tinyImage unlockFocus];
+ [image addRepresentation:[[tinyImage representations] lastObject]];
+ [tinyImage release];
}
return image;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit