From 634cf9a8221b4a39c21791362dae7d9ec737b86f Mon Sep 17 00:00:00 2001 From: dbenninger Date: Tue, 5 Dec 2017 22:12:12 +0100 Subject: [PATCH] Fix background scale quality (#5113) UIGraphicsBeginImageContextWithOptions with scale factor 0 makes sure the device scale factor is used automatically and not 1.0 --- tns-core-modules/ui/styling/background.ios.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tns-core-modules/ui/styling/background.ios.ts b/tns-core-modules/ui/styling/background.ios.ts index f1a4de3c1..ff173ec54 100644 --- a/tns-core-modules/ui/styling/background.ios.ts +++ b/tns-core-modules/ui/styling/background.ios.ts @@ -338,7 +338,7 @@ function uiColorFromImage(img: UIImage, view: View, callback: (uiColor: UIColor) if (params.sizeX > 0 && params.sizeY > 0) { const resizeRect = CGRectMake(0, 0, params.sizeX, params.sizeY); - UIGraphicsBeginImageContext(resizeRect.size); + UIGraphicsBeginImageContextWithOptions(resizeRect.size, false, 0.0); img.drawInRect(resizeRect); img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();