Skip to content

Commit

Permalink
vertical top-bias the badge by 60%, so that center'd loading text (e.…
Browse files Browse the repository at this point in the history
…g.: Flickr video) doesn't obscure the badge
  • Loading branch information
Simone Manganelli authored and Simone Manganelli committed Jul 25, 2009
1 parent 69ddaf9 commit 056f38b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,8 @@ - (void) _drawBadgeWithPressed: (BOOL) pressed
// Compute a scale factor based on the view's size.

float maxW = NSWidth( bounds ) - kMinMargin;
float maxH = NSHeight( bounds ) - kMinMargin;
// the 9/10 factor here is to account for the 60% vertical top-biasing
float maxH = NSHeight( bounds )*9/10 - kMinMargin;
float minW = kMinHeight * w / h;

BOOL rotate = NO;
Expand Down Expand Up @@ -861,7 +862,8 @@ - (void) _drawBadgeWithPressed: (BOOL) pressed
[ NSGraphicsContext saveGraphicsState ];

NSAffineTransform* xform = [ NSAffineTransform transform ];
[ xform translateXBy: NSWidth( bounds ) / 2 yBy: NSHeight( bounds ) / 2 ];
// vertical top-bias by 60% here
[ xform translateXBy: NSWidth( bounds ) / 2 yBy: NSHeight( bounds ) / 10 * 6 ];
[ xform scaleBy: scaleFactor ];
if( rotate )
[ xform rotateByDegrees: 90 ];
Expand Down

0 comments on commit 056f38b

Please sign in to comment.