Resolve a float point precision issue.

This commit is contained in:
WenchaoD 2017-07-01 12:28:53 +08:00
parent c44ae3ca4b
commit 616ea548e8
2 changed files with 5 additions and 1 deletions

View File

@ -361,7 +361,7 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
_collectionView.frame = _daysContainer.bounds;
}
_collectionView.fs_height = FSCalendarHalfFloor(_collectionView.fs_height);
_topBorder.frame = CGRectMake(0, -1, self.fs_width, 1);
_bottomBorder.frame = CGRectMake(0, self.fs_height, self.fs_width, 1);
_scopeHandle.fs_bottom = _bottomBorder.fs_top;

View File

@ -68,6 +68,10 @@ CG_EXTERN CGSize const CGSizeAutomatic;
#define FSCalendarMod(c1,c2) fmodf(c1,c2)
#endif
#define FSCalendarHalfRound(c) (FSCalendarRound(c*2)*0.5)
#define FSCalendarHalfFloor(c) (FSCalendarFloor(c*2)*0.5)
#define FSCalendarHalfCeil(c) (FSCalendarCeil(c*2)*0.5)
#define FSCalendarUseWeakSelf __weak __typeof__(self) FSCalendarWeakSelf = self;
#define FSCalendarUseStrongSelf __strong __typeof__(self) self = FSCalendarWeakSelf;