Re-enabled tab image code in the ExampleProject

This commit is contained in:
Justin Spahr-Summers
2012-07-24 17:26:08 -07:00
parent f134d07a4a
commit 26255d29b0
+2 -4
View File
@@ -87,19 +87,17 @@
// 2. generate an inner shadow image based on the mask, then overlay that on top
// TODO: Refactor this to use NSImage.
#if 0
image = [TUIImage imageWithSize:imageRect.size drawing:^(CGContextRef ctx) {
image = [NSImage imageWithSize:imageRect.size drawing:^(CGContextRef ctx) {
CGRect r;
r.origin = CGPointZero;
r.size = imageRect.size;
CGContextClipToMask(ctx, r, image.CGImage);
CGContextDrawLinearGradientBetweenPoints(ctx, CGPointMake(0, r.size.height), (CGFloat[]){0,0,1,1}, CGPointZero, (CGFloat[]){0,0.6,1,1});
TUIImage *innerShadow = [image innerShadowWithOffset:CGSizeMake(0, -1) radius:3.0 color:[TUIColor blackColor] backgroundColor:[TUIColor cyanColor]];
NSImage *innerShadow = [image innerShadowWithOffset:CGSizeMake(0, -1) radius:3.0 color:[TUIColor blackColor] backgroundColor:[TUIColor cyanColor]];
CGContextSetBlendMode(ctx, kCGBlendModeOverlay);
CGContextDrawImage(ctx, r, innerShadow.CGImage);
}];
#endif
}
[image drawInRect:imageRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; // draw 'image' (might be the regular one, or the dynamically generated one)