From 45b0859b7f4fa0ee8c515b4e11f136ed3783c2e6 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Wed, 6 Nov 2019 19:34:50 +0200 Subject: [PATCH] fix(ios): Fix image size when calling getDataURL with bounds. fixes #855 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- ios/Elements/RNSVGSvgView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Elements/RNSVGSvgView.m b/ios/Elements/RNSVGSvgView.m index 64d1485c..6cea082f 100644 --- a/ios/Elements/RNSVGSvgView.m +++ b/ios/Elements/RNSVGSvgView.m @@ -268,7 +268,7 @@ - (NSString *)getDataURLwithBounds:(CGRect)bounds { - UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0); + UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 1); [self clearChildCache]; [self drawRect:bounds]; [self clearChildCache];