Skip to content

Commit 634cf9a

Browse files
dbenningerSvetoslavTsenov
authored andcommitted
Fix background scale quality (NativeScript#5113)
UIGraphicsBeginImageContextWithOptions with scale factor 0 makes sure the device scale factor is used automatically and not 1.0
1 parent 57ed0cf commit 634cf9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tns-core-modules/ui/styling/background.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ function uiColorFromImage(img: UIImage, view: View, callback: (uiColor: UIColor)
338338

339339
if (params.sizeX > 0 && params.sizeY > 0) {
340340
const resizeRect = CGRectMake(0, 0, params.sizeX, params.sizeY);
341-
UIGraphicsBeginImageContext(resizeRect.size);
341+
UIGraphicsBeginImageContextWithOptions(resizeRect.size, false, 0.0);
342342
img.drawInRect(resizeRect);
343343
img = UIGraphicsGetImageFromCurrentImageContext();
344344
UIGraphicsEndImageContext();

0 commit comments

Comments
 (0)