Skip to content

Commit a358681

Browse files
committed
fix potential crash in iOS7: ibireme#261
1 parent 6ce3279 commit a358681

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

YYText/Component/YYTextEffectWindow.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ - (void)_updateSelectionGrabberDot:(YYSelectionGrabberDot *)dot selection:(YYTex
399399
}
400400
}
401401
CGPoint center = [dot yy_convertPoint:CGPointMake(CGRectGetWidth(dot.frame) / 2, CGRectGetHeight(dot.frame) / 2) toViewOrWindow:self];
402-
dot.mirror.center = center;
402+
if (isnan(center.x) || isnan(center.y) || isinf(center.x) || isinf(center.y)) {
403+
dot.mirror.hidden = YES;
404+
} else {
405+
dot.mirror.center = center;
406+
}
403407
}
404408

405409
- (void)showSelectionDot:(YYTextSelectionView *)selection {

0 commit comments

Comments
 (0)