Skip to content

Commit

Permalink
fix(ios): Fix image size when calling getDataURL with bounds. fixes #855
Browse files Browse the repository at this point in the history


UIGraphicsBeginImageContextWithOptions third argument was incorrect:

https://developer.apple.com/documentation/uikit/1623912-uigraphicsbeginimagecontextwitho
The scale factor to apply to the bitmap. If you specify a value of 0.0,
the scale factor is set to the scale factor of the device’s main screen.
  • Loading branch information
msand committed Nov 6, 2019
1 parent ea29b02 commit 45b0859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Elements/RNSVGSvgView.m
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ - (NSString *)getDataURL

- (NSString *)getDataURLwithBounds:(CGRect)bounds
{
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 1);
[self clearChildCache];
[self drawRect:bounds];
[self clearChildCache];
Expand Down

0 comments on commit 45b0859

Please sign in to comment.