Skip to content

Commit

Permalink
Fixed: Auto-scrolling to the most bottom row even if this is not nece…
Browse files Browse the repository at this point in the history
…ssary. Also, some logging stuff was removed.
  • Loading branch information
cocoabits committed Oct 7, 2010
1 parent f72dbc6 commit 8ac7f90
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions AQGridView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,14 @@
isa = PBXProject;
buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "AQGridView" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 0867D691FE84028FC02AAC07 /* AQGridView */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
Expand Down
4 changes: 4 additions & 0 deletions Classes/AQGridView.m
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ - (BOOL) isAnimatingUpdates

- (void) updateContentRectWithOldMaxLocation: (CGPoint) oldMaxLocation gridSize: (CGSize) gridSize
{
// The following line prevents an update leading to unneccessary auto-scrolling
// Before this fix, AQGridView animation always caused scrolling to the most bottom line
if (CGSizeEqualToSize(self.contentSize, gridSize)) return;

// update content size
self.contentSize = gridSize;

Expand Down
6 changes: 4 additions & 2 deletions Classes/AQGridViewUpdateInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ - (NSSet *) animateCellUpdatesUsingVisibleContentRect: (CGRect) contentRect
// indices of items visible from old grid
NSIndexSet * oldVisibleIndices = [_oldGridData indicesOfCellsInRect: contentRect];

NSLog( @"Updating from original content rect %@", NSStringFromCGRect(contentRect) );
// The line below is commented because it produces too many logs
// NSLog( @"Updating from original content rect %@", NSStringFromCGRect(contentRect) );

if ( (isVertical) && (maxY > gridSize.height) )
{
Expand Down Expand Up @@ -637,7 +638,8 @@ - (NSSet *) animateCellUpdatesUsingVisibleContentRect: (CGRect) contentRect
[_gridView updateGridViewBoundsForNewGridData: _newGridData];
}

NSLog( @"Updated content rect: %@", NSStringFromCGRect(contentRect) );
// The line below is fixed because it produces too many logs
//NSLog( @"Updated content rect: %@", NSStringFromCGRect(contentRect) );
NSIndexSet * newVisibleIndices = [_newGridData indicesOfCellsInRect: contentRect];

NSMutableSet * newVisibleCells = [[NSMutableSet alloc] initWithSet: _gridView.animatingCells];
Expand Down

0 comments on commit 8ac7f90

Please sign in to comment.