@@ -217,34 +217,24 @@ internal UIEdgeInsets GetInsetForSection(ItemsViewLayout itemsViewLayout,
217
217
return uIEdgeInsets ;
218
218
}
219
219
220
- // If we're grouping, we'll need to inset the sections to maintain the item spacing between the
221
- // groups and/or their group headers/footers
220
+ // If we're grouping, we'll need to inset the sections to maintain the spacing between the
221
+ // groups and their group headers/footers
222
222
223
- var itemsLayout = ItemsView . ItemsLayout ;
224
- var scrollDirection = itemsViewLayout . ScrollDirection ;
225
- nfloat lineSpacing = itemsViewLayout . GetMinimumLineSpacingForSection ( collectionView , itemsViewLayout , section ) ;
223
+ nfloat spacing = itemsViewLayout . GetMinimumLineSpacingForSection ( collectionView , itemsViewLayout , section ) ;
226
224
227
- if ( itemsLayout is GridItemsLayout )
228
- {
229
- nfloat itemSpacing = itemsViewLayout . GetMinimumInteritemSpacingForSection ( collectionView , itemsViewLayout , section ) ;
230
-
231
- if ( scrollDirection == UICollectionViewScrollDirection . Horizontal )
232
- {
233
- return new UIEdgeInsets ( itemSpacing + uIEdgeInsets . Top , lineSpacing + uIEdgeInsets . Left ,
234
- uIEdgeInsets . Bottom , uIEdgeInsets . Right ) ;
235
- }
225
+ var top = uIEdgeInsets . Top ;
226
+ var left = uIEdgeInsets . Left ;
236
227
237
- return new UIEdgeInsets ( lineSpacing + uIEdgeInsets . Top , itemSpacing + uIEdgeInsets . Left ,
238
- uIEdgeInsets . Bottom , uIEdgeInsets . Right ) ;
228
+ if ( itemsViewLayout . ScrollDirection == UICollectionViewScrollDirection . Horizontal )
229
+ {
230
+ left += spacing ;
239
231
}
240
-
241
- if ( scrollDirection == UICollectionViewScrollDirection . Horizontal )
232
+ else
242
233
{
243
- return new UIEdgeInsets ( uIEdgeInsets . Top , lineSpacing + uIEdgeInsets . Left ,
244
- uIEdgeInsets . Bottom , uIEdgeInsets . Right ) ;
234
+ top += spacing ;
245
235
}
246
236
247
- return new UIEdgeInsets ( lineSpacing + uIEdgeInsets . Top , uIEdgeInsets . Left ,
237
+ return new UIEdgeInsets ( top , left ,
248
238
uIEdgeInsets . Bottom , uIEdgeInsets . Right ) ;
249
239
}
250
240
0 commit comments