before applying the gradient to the status and filter bars, check that the remaining rect is not empty

This commit is contained in:
Mitchell Livingston
2011-09-14 03:31:34 +00:00
parent c9cf99d9cc
commit f6579d58b2
2 changed files with 18 additions and 12 deletions

View File

@@ -80,10 +80,13 @@
rect.size.height -= 1.0;
}
NSRectFillListWithColors(gridRects, colorRects, count);
if (!NSIsEmptyRect(rect))
{
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
[fGradient drawInRect: gradientRect angle: 270.0];
}
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
[fGradient drawInRect: gradientRect angle: 270.0];
NSRectFillListWithColors(gridRects, colorRects, count);
}
@end

View File

@@ -99,16 +99,19 @@
rect.size.height -= 1.0;
}
if (active)
if (!NSIsEmptyRect(rect))
{
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
[fGradient drawInRect: gradientRect angle: 270.0];
}
else
{
gridRects[count] = rect;
colorRects[count] = [NSColor colorWithCalibratedWhite: 0.85 alpha: 1.0];
++count;
if (active)
{
const NSRect gradientRect = NSMakeRect(NSMinX(rect), 1.0, NSWidth(rect), NSHeight([self bounds]) - 1.0 - 1.0); //proper gradient requires the full height of the bar
[fGradient drawInRect: gradientRect angle: 270.0];
}
else
{
gridRects[count] = rect;
colorRects[count] = [NSColor colorWithCalibratedWhite: 0.85 alpha: 1.0];
++count;
}
}
NSRectFillListWithColors(gridRects, colorRects, count);