Permalink
Browse files

vertical top-bias the badge by 60%, so that center'd loading text (e.…

…g.: Flickr video) doesn't obscure the badge
  • Loading branch information...
1 parent 69ddaf9 commit 056f38b4a23b9e9b5494efdd35e6a25f0890209d Simone Manganelli committed Jul 25, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 Plugin/Plugin.m
View
@@ -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;
@@ -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 ];

0 comments on commit 056f38b

Please sign in to comment.