gmoledina / GMGridView

A performant Grid-View for iOS (iPhone/iPad) that allows sorting of views with gestures (the user can move the items with his finger to sort them) and pinching/rotating/panning gestures allow the user to play with the view and toggle from the cellview to a fullsize display.
MIT License
2.3k stars 512 forks source link

scrollToObjectAtIndex is not working properly when paging is enabled #196

Closed SrikanthKabadi closed 11 years ago

SrikanthKabadi commented 11 years ago

Hi there,

Thank you so much for this great source but I found an issue where in, there is a problem with "scrollToObjectAtIndex" function when paging is enabled. It doesn't scroll to given cell index. I checked for this issue even with the demo application and the problem exists in example app as well. Please provide a fix for this issue.

Thank you, Srikanth

SrikanthKabadi commented 11 years ago

Found a solution for this issue. Just change

CGFloat pageX = ceilf(point.x / pageSize.width); CGFloat pageY = ceilf(point.y / pageSize.height);

to

CGFloat pageX = floorf(point.x / pageSize.width); CGFloat pageY = floorf(point.y / pageSize.height);

in function