mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-27 12:41:49 +00:00
feat: remove UIGraphicsBeginImageContextWithOptions from repo (#2117)
Since UIGraphicsBeginImageContextWithOptions will be depracated in iOS 17 (developer.apple.com/documentation/uikit/1623912-uigraphicsbeginimagecontextwitho), I changed the implementation to not use it and use UIGraphicsImageRenderer instead. Also added Mask examples to be able to test it.
This commit is contained in:
@@ -39,7 +39,7 @@ RCT_EXPORT_MODULE()
|
||||
if ([view isKindOfClass:[RNSVGSvgView class]]) {
|
||||
RNSVGSvgView *svg = view;
|
||||
if (options == nil) {
|
||||
b64 = [svg getDataURL];
|
||||
b64 = [svg getDataURLWithBounds:svg.boundingBox];
|
||||
} else {
|
||||
id width = [options objectForKey:@"width"];
|
||||
id height = [options objectForKey:@"height"];
|
||||
@@ -53,7 +53,7 @@ RCT_EXPORT_MODULE()
|
||||
NSInteger hi = (NSInteger)[h intValue];
|
||||
|
||||
CGRect bounds = CGRectMake(0, 0, wi, hi);
|
||||
b64 = [svg getDataURLwithBounds:bounds];
|
||||
b64 = [svg getDataURLWithBounds:bounds];
|
||||
}
|
||||
} else {
|
||||
RCTLogError(@"Invalid svg returned from registry, expecting RNSVGSvgView, got: %@", view);
|
||||
|
||||
Reference in New Issue
Block a user