Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
CPTableView: -drawBackroundInClipRect:
Browse files Browse the repository at this point in the history
Fixes a bug where we were drawing rows from 0 instead of the first exposed when usesAlternatingBackgroundColors:YES
  • Loading branch information
cacaodev committed Aug 11, 2011
1 parent 2b77da8 commit 9f06ed7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions AppKit/CPTableView.j
Expand Up @@ -3544,16 +3544,16 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
}

var exposedRows = [self _unboundedRowsInRect:aRect],
firstRow = FLOOR(exposedRows.location / colorCount) * colorCount,
lastRow = CPMaxRange(exposedRows),
colorIndex = 0,
groupRowRects = [],
row = exposedRows.location;
groupRowRects = [];

//loop through each color so we only draw once for each color
while (colorIndex < colorCount)
{
CGContextBeginPath(context);
for (var row = colorIndex; row <= lastRow; row += colorCount)
for (var row = firstRow + colorIndex; row <= lastRow; row += colorCount)
{
// if it's not a group row draw it otherwise we draw it later
if (![_groupRows containsIndex:row])
Expand Down

0 comments on commit 9f06ed7

Please sign in to comment.