Răsfoiți Sursa

fix potential crash in iOS7: #261

ibireme 9 ani în urmă
părinte
comite
a358681e91
1 a modificat fișierele cu 5 adăugiri și 1 ștergeri
  1. 5 1
      YYText/Component/YYTextEffectWindow.m

+ 5 - 1
YYText/Component/YYTextEffectWindow.m

@@ -399,7 +399,11 @@
         }
     }
     CGPoint center = [dot yy_convertPoint:CGPointMake(CGRectGetWidth(dot.frame) / 2, CGRectGetHeight(dot.frame) / 2) toViewOrWindow:self];
-    dot.mirror.center = center;
+    if (isnan(center.x) || isnan(center.y) || isinf(center.x) || isinf(center.y)) {
+        dot.mirror.hidden = YES;
+    } else {
+        dot.mirror.center = center;
+    }
 }
 
 - (void)showSelectionDot:(YYTextSelectionView *)selection {