Skip to content

Commit

Permalink
fixed crash loop infinitive when compare float by using FLT_EPSILON (#…
Browse files Browse the repository at this point in the history
…1581)

Co-authored-by: CookNguyen <cnguyen@youmail.com>
  • Loading branch information
vancucit and CookNguyen authored Apr 5, 2023
1 parent 2781d8b commit 8a2848d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MJRefresh/Base/MJRefreshHeader.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (void)resetInset {
insetT = insetT > self.mj_h + _scrollViewOriginalInset.top ? self.mj_h + _scrollViewOriginalInset.top : insetT;
self.insetTDelta = _scrollViewOriginalInset.top - insetT;
// 避免 CollectionView 在使用根据 Autolayout 和 内容自动伸缩 Cell, 刷新时导致的 Layout 异常渲染问题
if (self.scrollView.mj_insetT != insetT) {
if (fabs(self.scrollView.mj_insetT - insetT) > FLT_EPSILON) {
self.scrollView.mj_insetT = insetT;
}
}
Expand Down

0 comments on commit 8a2848d

Please sign in to comment.