Skip to content

Commit

Permalink
Update center drawing code
Browse files Browse the repository at this point in the history
  • Loading branch information
kgn committed Apr 5, 2012
1 parent 4dfee3a commit 0dd647d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions OSX/KGMenuBarPopup.m
Expand Up @@ -183,12 +183,12 @@ - (void)dealloc{
self.menuBarPopupPanel = nil; self.menuBarPopupPanel = nil;
} }


- (void)drawImage:(NSImage *)aImage centeredInRect:(NSRect)aRect{ - (void)drawImage:(NSImage *)image centeredInRect:(NSRect)rect{
NSRect imageRect = NSMakeRect((CGFloat)round(aRect.size.width*0.5f-aImage.size.width*0.5f), NSRect imageRect = NSZeroRect;
(CGFloat)round(aRect.size.height*0.5f-aImage.size.height*0.5f), imageRect.origin.x = round(KGMidWidth(rect)-image.size.width*0.5f);
aImage.size.width, imageRect.origin.y = round(KGMidHeight(rect)-image.size.height*0.5f);
aImage.size.height); imageRect.size = image.size;
[aImage drawInRect:imageRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f]; [image drawInRect:imageRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0f];
} }


- (void)drawRect:(NSRect)rect{ - (void)drawRect:(NSRect)rect{
Expand Down

0 comments on commit 0dd647d

Please sign in to comment.