Skip to content

Commit 8a2848d

Browse files
vancucitCookNguyen
and
CookNguyen
authored
fixed crash loop infinitive when compare float by using FLT_EPSILON (#1581)
Co-authored-by: CookNguyen <[email protected]>
1 parent 2781d8b commit 8a2848d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MJRefresh/Base/MJRefreshHeader.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ - (void)resetInset {
6565
insetT = insetT > self.mj_h + _scrollViewOriginalInset.top ? self.mj_h + _scrollViewOriginalInset.top : insetT;
6666
self.insetTDelta = _scrollViewOriginalInset.top - insetT;
6767
// 避免 CollectionView 在使用根据 Autolayout 和 内容自动伸缩 Cell, 刷新时导致的 Layout 异常渲染问题
68-
if (self.scrollView.mj_insetT != insetT) {
68+
if (fabs(self.scrollView.mj_insetT - insetT) > FLT_EPSILON) {
6969
self.scrollView.mj_insetT = insetT;
7070
}
7171
}

0 commit comments

Comments
 (0)