File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -423,6 +423,10 @@ - (BOOL) isAnimatingUpdates
423423
424424- (void ) updateContentRectWithOldMaxLocation : (CGPoint) oldMaxLocation gridSize : (CGSize) gridSize
425425{
426+ // The following line prevents an update leading to unneccessary auto-scrolling
427+ // Before this fix, AQGridView animation always caused scrolling to the most bottom line
428+ if (CGSizeEqualToSize (self.contentSize , gridSize)) return ;
429+
426430 // update content size
427431 self.contentSize = gridSize;
428432
Original file line number Diff line number Diff line change @@ -730,7 +730,8 @@ - (NSSet *) animateCellUpdatesUsingVisibleContentRect: (CGRect) contentRect
730730 // indices of items visible from old grid
731731 NSIndexSet * oldVisibleIndices = [_oldGridData indicesOfCellsInRect: contentRect];
732732
733- NSLog ( @" Updating from original content rect %@ " , NSStringFromCGRect(contentRect) );
733+ // The line below is commented because it produces too many logs
734+ // NSLog( @"Updating from original content rect %@", NSStringFromCGRect(contentRect) );
734735
735736 if ( (isVertical) && (maxY > gridSize.height ) )
736737 {
@@ -759,7 +760,8 @@ - (NSSet *) animateCellUpdatesUsingVisibleContentRect: (CGRect) contentRect
759760 [_gridView updateGridViewBoundsForNewGridData: _newGridData];
760761 }
761762
762- NSLog ( @" Updated content rect: %@ " , NSStringFromCGRect(contentRect) );
763+ // The line below is fixed because it produces too many logs
764+ // NSLog( @"Updated content rect: %@", NSStringFromCGRect(contentRect) );
763765 NSIndexSet * newVisibleIndices = [_newGridData indicesOfCellsInRect: contentRect];
764766
765767 NSMutableSet * newVisibleCells = [[NSMutableSet alloc ] initWithSet: _gridView.animatingCells];
You can’t perform that action at this time.
0 commit comments