Closed sconix closed 7 years ago
I'm going to have to try this to get an idea of what the change does, if that's OK? I think I get it but I'd like to see it for myself first. What col_width
/row_height
values are you using?
So what this does is that we have the grid set to fill the available space and col_width / row_height are set to 162/136 with margin being 16. And we are using the limit_to_screen so the grid width naturally is not always evenly dividable with the 162+margin so without this feature the grid items would only be centered to the view when the grid width is evenly dividable with 162+margin. With this feature the grid is always center when center_to_screen is set to true.
I pushed the change with the refactoring for the re-positioning of the items. This was my original implementation anyway, but decided to go with the less code replication in the end.
I made a couple little changes, but it's in master now. Thanks 👍
Thanks! Also thanks for this nice library, we tried pretty much all grid related libraries and all others were really buggy and most of them tried to do too much like provide scrolling etc.
Hi, would it be possible for you to make new release with this feature? Since I see that there still hasn't been new release after adding this and we are getting close to releasing our app so would be nice to have only released package versions in the app when we ship it. The feature has been working nicely for us, been using it through our own custom build.
Yes! Apologies, I'll try to get it out this weekend
Released in version 2.1.0
This adds new center_to_screen configuration option which will center the grid to the screen when using limit_to_screen. This is done by calculating screenMargin which is used in calculating the position for the placeholder / items.