From 9f06ed725e3113b60186fdc9f56be66debf3971b Mon Sep 17 00:00:00 2001 From: cacaodev Date: Thu, 11 Aug 2011 21:06:19 +0200 Subject: [PATCH] CPTableView: -drawBackroundInClipRect: Fixes a bug where we were drawing rows from 0 instead of the first exposed when usesAlternatingBackgroundColors:YES --- AppKit/CPTableView.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 2853079a4..5b20634ce 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -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])