Skip to content

Commit

Permalink
[PATCH]: react-native-fast-image iOS 17 spec (#5188)
Browse files Browse the repository at this point in the history
* fix: patch rnfi to iOS 17 spec

* add initial and new patch

* delete original patch file

* add nl char
  • Loading branch information
walmat committed Nov 15, 2023
1 parent b433c99 commit f2eebc5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions patches/react-native-fast-image+8.5.11+fix-make-image.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m b/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
index 9c0f1d3..db4da88 100644
--- a/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
+++ b/node_modules/react-native-fast-image/ios/FastImage/FFFastImageView.m
@@ -70,12 +70,12 @@ - (void)setImageColor:(UIColor *)imageColor {
}

- (UIImage*)makeImage:(UIImage *)image withTint:(UIColor *)color {
- UIImage *newImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
- UIGraphicsBeginImageContextWithOptions(image.size, NO, newImage.scale);
- [color set];
- [newImage drawInRect:CGRectMake(0, 0, image.size.width, newImage.size.height)];
- newImage = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
+ UIImage* newImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
+ UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:image.size];
+ newImage = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) {
+ [color setFill];
+ [newImage drawInRect:CGRectMake(0, 0, image.size.width, newImage.size.height)];
+ }];
return newImage;
}

0 comments on commit f2eebc5

Please sign in to comment.