Skip to content

Commit b5e50e7

Browse files
committed
Adding CGFloat rounding to avoid layout issues. Fixes CEWendel#253
1 parent aa8dab3 commit b5e50e7

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

SWTableViewCell/PodFiles/SWTableViewCell.m

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,17 +526,29 @@ - (BOOL)isUtilityButtonsHidden {
526526

527527
- (CGFloat)leftUtilityButtonsWidth
528528
{
529-
return CGRectGetWidth(self.leftUtilityButtonsView.frame);
529+
#if CGFLOAT_IS_DOUBLE
530+
return round(CGRectGetWidth(self.leftUtilityButtonsView.frame));
531+
#else
532+
return roundf(CGRectGetWidth(self.leftUtilityButtonsView.frame));
533+
#endif
530534
}
531535

532536
- (CGFloat)rightUtilityButtonsWidth
533537
{
534-
return CGRectGetWidth(self.rightUtilityButtonsView.frame) + self.additionalRightPadding;
538+
#if CGFLOAT_IS_DOUBLE
539+
return round(CGRectGetWidth(self.rightUtilityButtonsView.frame) + self.additionalRightPadding);
540+
#else
541+
return roundf(CGRectGetWidth(self.rightUtilityButtonsView.frame) + self.additionalRightPadding);
542+
#endif
535543
}
536544

537545
- (CGFloat)utilityButtonsPadding
538546
{
539-
return [self leftUtilityButtonsWidth] + [self rightUtilityButtonsWidth];
547+
#if CGFLOAT_IS_DOUBLE
548+
return round([self leftUtilityButtonsWidth] + [self rightUtilityButtonsWidth]);
549+
#else
550+
return roundf([self leftUtilityButtonsWidth] + [self rightUtilityButtonsWidth]);
551+
#endif
540552
}
541553

542554
- (CGPoint)contentOffsetForCellState:(SWCellState)state

0 commit comments

Comments
 (0)