Skip to content

Commit

Permalink
[CHANGE] Eliminate stray thin gray line along outside light border.
Browse files Browse the repository at this point in the history
  • Loading branch information
rentzsch committed Aug 25, 2009
1 parent e84a62a commit 00a3911
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -899,26 +899,20 @@ - (void) _drawBadgeWithPressed: (BOOL) pressed
NSPoint loc = { -strSize.width / 2, -strSize.height / 2 };
NSRect borderRect = NSMakeRect( loc.x - kFrameXInset, loc.y - kFrameYInset, w, h );

NSBezierPath* fillPath = bezierPathWithRoundedRectCornerRadius( NSInsetRect( borderRect, -2, -2 ), 6 );
[ [ NSColor colorWithCalibratedWhite: 1.0 alpha: 0.45 ] set ];
[ fillPath fill ];

NSUInteger thickLineWidth = 5;
NSBezierPath* path = bezierPathWithRoundedRectCornerRadius( borderRect, 4 );
[ [ NSColor blackColor ] set ];
[ path setLineWidth: thickLineWidth ];
[ path stroke ];

NSUInteger thinLineWidth = 2;
NSRect thinBorderRect = NSMakeRect( loc.x - kFrameXInset - thickLineWidth/4,
loc.y - kFrameYInset - thickLineWidth/4,
w + thickLineWidth/2,
h + thickLineWidth/2);
NSBezierPath* thinPath = bezierPathWithRoundedRectCornerRadius( thinBorderRect, 4 );
[ [ NSColor whiteColor ] set ];
[ thinPath setLineWidth: thinLineWidth ];
[ thinPath stroke ];

NSBezierPath* fillPath = bezierPathWithRoundedRectCornerRadius( borderRect, 4 );
[ [ NSColor colorWithCalibratedWhite: 1.0 alpha: 0.45 ] set ];
[ fillPath fill ];

NSBezierPath* darkBorderPath = bezierPathWithRoundedRectCornerRadius( borderRect, 4 );
[[NSColor blackColor] set];
[ darkBorderPath setLineWidth: 3 ];
[ darkBorderPath stroke ];

NSBezierPath* lightBorderPath = bezierPathWithRoundedRectCornerRadius( NSInsetRect(borderRect, -2, -2), 6 );
[ [ NSColor colorWithCalibratedWhite: 1.0 alpha: 0.45 ] set ];
[ lightBorderPath setLineWidth: 2 ];
[ lightBorderPath stroke ];

[ str drawAtPoint: loc withAttributes: attrs ];

// Now restore the graphics state:
Expand Down

0 comments on commit 00a3911

Please sign in to comment.