Changeset 13456


Ignore:
Timestamp:
Aug 30, 2012, 3:40:13 AM (9 years ago)
Author:
livings124
Message:

when drawing the status bar lines, don't assume the full lines will be drawn (although they probably will be)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/StatusBarView.m

    r13455 r13456  
    9393    NSColor * colorRects[active ? 2 : 3];
    9494   
    95     NSRect lineBorderRect = NSMakeRect(NSMinX(rect), NSHeight([self bounds]) - 1.0, NSWidth(rect), 1.0);
     95    NSRect lineBorderRect = NSMakeRect(NSMinX(rect), 0.0, NSWidth(rect), 1.0);
     96    NSRect intersectLineBorderRect = NSIntersectionRect(lineBorderRect, rect);
     97    if (!NSIsEmptyRect(intersectLineBorderRect))
     98    {
     99        gridRects[count] = intersectLineBorderRect;
     100        colorRects[count] = active ? [NSColor colorWithCalibratedWhite: 0.25 alpha: 1.0]
     101        : [NSColor colorWithCalibratedWhite: 0.5 alpha: 1.0];
     102        ++count;
     103       
     104        rect.origin.y += intersectLineBorderRect.size.height;
     105        rect.size.height -= intersectLineBorderRect.size.height;
     106    }
     107   
    96108    if (active)
    97109    {
    98         if (NSIntersectsRect(lineBorderRect, rect))
     110        lineBorderRect.origin.y = NSHeight([self bounds]) - 1.0;
     111        intersectLineBorderRect = NSIntersectionRect(lineBorderRect, rect);
     112        if (!NSIsEmptyRect(intersectLineBorderRect))
    99113        {
    100             gridRects[count] = lineBorderRect;
     114            gridRects[count] = intersectLineBorderRect;
    101115            colorRects[count] = [NSColor colorWithCalibratedWhite: 0.75 alpha: 1.0];
    102116            ++count;
    103117           
    104             rect.size.height -= 1.0;
     118            rect.size.height -= intersectLineBorderRect.size.height;
    105119        }
    106     }
    107    
    108     lineBorderRect.origin.y = 0.0;
    109     if (NSIntersectsRect(lineBorderRect, rect))
    110     {
    111         gridRects[count] = lineBorderRect;
    112         colorRects[count] = active ? [NSColor colorWithCalibratedWhite: 0.25 alpha: 1.0]
    113                                     : [NSColor colorWithCalibratedWhite: 0.5 alpha: 1.0];
    114         ++count;
    115        
    116         rect.origin.y += 1.0;
    117         rect.size.height -= 1.0;
    118120    }
    119121   
Note: See TracChangeset for help on using the changeset viewer.