Procházet zdrojové kódy

fixed crash loop infinitive when compare float by using FLT_EPSILON (#1581)

Co-authored-by: CookNguyen <cnguyen@youmail.com>
cuc před 2 roky
rodič
revize
8a2848d154
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      MJRefresh/Base/MJRefreshHeader.m

+ 1 - 1
MJRefresh/Base/MJRefreshHeader.m

@@ -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;
     }
 }