Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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 from

2 participants

@jpvasquez

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

@AnanthAtGis

Hi @jpvasquez , you really solved the issue. Now reloading works good. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 10, 2012
  1. @jpvasquez

    Fixes various bug which causes a cell to be added twice and various r…

    jpvasquez authored
    …edrawing errors to occur afterwards
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +7 −1 DTGridView.m
View
8 DTGridView.m
@@ -199,7 +199,13 @@ - (void)addCellWithInfo:(NSObject<DTGridViewCellInfoProtocol> *)info {
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];
Something went wrong with that request. Please try again.