let padding = collectionViewInsets.left + collectionViewInsets.right
let availableWidth = view.frame.width - padding
let itemWidth = availableWidth / CGFloat(itemsPerRow)
For some collectionView sizes itemWidth resolves as non round float, that causes a small visual glitches.
I added a mechanism that would find the closest insets that could satisfy the resolving into a rounded float. Resolving happens with preserving insets ratio like (20/20, 10/30, etc)
Fix for https://github.com/miraan/CalendarDateRangePickerViewController/issues/5
The problem was that in cell width calculation
For some collectionView sizes
itemWidth
resolves as non round float, that causes a small visual glitches.I added a mechanism that would find the closest insets that could satisfy the resolving into a rounded float. Resolving happens with preserving insets ratio like (20/20, 10/30, etc)