Skip to content

Commit 5b5369a

Browse files
committed
Fix quality loss in snapshot image
1 parent a08fdd0 commit 5b5369a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MGSwipeTableCell/MGSwipeTableCell.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,8 @@ -(UIView *) hitTest:(CGPoint)point withEvent:(UIEvent *)event
10261026
#pragma mark Some utility methods
10271027

10281028
- (UIImage *)imageFromView:(UIView *)view cropSize:(CGSize)cropSize{
1029-
UIGraphicsBeginImageContextWithOptions(cropSize, NO, [[UIScreen mainScreen] scale]);
1030-
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
1029+
UIGraphicsBeginImageContextWithOptions(cropSize, NO, 0);
1030+
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:NO];
10311031
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
10321032
UIGraphicsEndImageContext();
10331033
return image;

0 commit comments

Comments
 (0)