Explorar o código

fix potential crash in iOS7: #261

ibireme %!s(int64=9) %!d(string=hai) anos
pai
achega
a358681e91
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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 {