mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix background scale quality (#5113)
UIGraphicsBeginImageContextWithOptions with scale factor 0 makes sure the device scale factor is used automatically and not 1.0
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user