1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-13 07:33:02 +00:00

slightly more efficient drawing in the status bar (avoids filling in the whole bar and then drawing lines on top of it)

This commit is contained in:
Mitchell Livingston 2008-03-28 13:32:44 +00:00
parent 79931a5b6a
commit dbcbd99bf0

View file

@ -58,16 +58,13 @@
{
if (fShow)
{
[[NSColor controlColor] set];
NSRectFill(rect);
NSRect bounds = [self bounds];
NSRect lineBorderRect = NSMakeRect(bounds.origin.x, NSMaxY(bounds) - 1.0, bounds.size.width, 1.0);
NSRect lineBorderRect = NSMakeRect(rect.origin.x, NSMaxY([self bounds]) - 1.0, rect.size.width, 1.0);
if (NSIntersectsRect(lineBorderRect, rect))
{
[[NSColor whiteColor] set];
NSRectFill(lineBorderRect);
rect.size.height--;
}
lineBorderRect.origin.y = 0.0;
@ -75,7 +72,13 @@
{
[fGrayBorderColor set];
NSRectFill(lineBorderRect);
rect.origin.y++;
rect.size.height--;
}
[[NSColor controlColor] set];
NSRectFill(rect);
}
}