Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Fixes a bug which causes a cell to be added twice and various redrawing errors to occur afterwards #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion DTGridView.m
Expand Up @@ -199,7 +199,13 @@ - (void)addCellWithInfo:(NSObject<DTGridViewCellInfoProtocol> *)info {


if (![info isMemberOfClass:[DTGridViewCellInfo class]]) return; if (![info isMemberOfClass:[DTGridViewCellInfo class]]) return;


[cellInfoForCellsOnScreen addObject:info]; NSUInteger idx = [cellInfoForCellsOnScreen indexOfObjectPassingTest:^BOOL(DTGridViewCellInfo *i, NSUInteger idx, BOOL *stop) {
return info.xPosition == i.xPosition && info.yPosition == i.yPosition;
}];
if(idx == NSNotFound)
[cellInfoForCellsOnScreen addObject:info];
else
[cellInfoForCellsOnScreen replaceObjectAtIndex:idx withObject:info];


[cellInfoForCellsOnScreen sortUsingFunction:intSort context:NULL]; [cellInfoForCellsOnScreen sortUsingFunction:intSort context:NULL];


Expand Down