// Work out the area
CGFloat scaleFactor = rep.pixelsWide / rep.size.width;
- CGFloat pointSize = 10 * scaleFactor;
+ CGFloat typeSize = 10;
+ if (scaleFactor > 1)
+ {
+ typeSize = 8;
+ }
+ CGFloat pointSize = typeSize * scaleFactor;
NSFont *font = [NSFont boldSystemFontOfSize:pointSize];
NSDictionary *attr = @{NSParagraphStyleAttributeName : paragraphStyle,
options:0
attributes:attr];
- NSPoint indent = NSMakePoint(10 * scaleFactor, 2 * scaleFactor);
+ NSPoint indent = NSMakePoint(typeSize * scaleFactor, 2 * scaleFactor);
CGFloat radius = (textBounds.size.height + indent.y) * 0.5f;
- NSRect badgeRect = NSMakeRect(0, 0,
+ CGFloat offset_x = 0;
+ CGFloat offset_y = 0;
+ if (scaleFactor > 1)
+ {
+ offset_y = 2 * scaleFactor;
+ }
+ NSRect badgeRect = NSMakeRect(size.width - textBounds.size.width - indent.x - offset_x, offset_y,
textBounds.size.width + indent.x, textBounds.size.height + indent.y);
badgeRect = NSIntegralRect(badgeRect);