Browse files

Cleaned up some code

  • Loading branch information...
1 parent c0c2355 commit 254b0c9920b0f9d43624575c6cb2b6add9955cd3 Brandon Walkin committed Aug 27, 2009
Showing with 7 additions and 16 deletions.
  1. +7 −16 BWTransparentPopUpButtonCell.m
View
23 BWTransparentPopUpButtonCell.m
@@ -75,17 +75,15 @@ - (void)drawImageWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
if ([image isTemplate])
newImage = [image bwTintedImageWithColor:[self interiorColor]];
- NSAffineTransform* xform = [NSAffineTransform transform];
- [xform translateXBy:0.0 yBy:cellFrame.size.height];
- [xform scaleXBy:1.0 yBy:-1.0];
- [xform concat];
+ NSAffineTransform* transform = [NSAffineTransform transform];
+ [transform translateXBy:0.0 yBy:cellFrame.size.height];
+ [transform scaleXBy:1.0 yBy:-1.0];
+ [transform concat];
[newImage drawInRect:[self imageRectForBounds:cellFrame] fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1];
- NSAffineTransform* xform2 = [NSAffineTransform transform];
- [xform2 translateXBy:0.0 yBy:cellFrame.size.height];
- [xform2 scaleXBy:1.0 yBy:-1.0];
- [xform2 concat];
+ [transform invert];
+ [transform concat];
}
}
@@ -151,14 +149,7 @@ - (NSDictionary *)_textAttributes
- (NSColor *)interiorColor
{
- NSColor *interiorColor;
-
- if ([self isEnabled])
- interiorColor = enabledColor;
- else
- interiorColor = disabledColor;
-
- return interiorColor;
+ return [self isEnabled] ? enabledColor : disabledColor;
}
- (NSControlSize)controlSize

0 comments on commit 254b0c9

Please sign in to comment.