mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Fill image context with background color if image node is opaque
This commit is contained in:
@@ -227,6 +227,12 @@
|
||||
// Use contentsScale of 1.0 and do the contentsScale handling in boundsSizeInPixels so ASCroppedImageBackingSizeAndDrawRectInBounds
|
||||
// will do its rounding on pixel instead of point boundaries
|
||||
UIGraphicsBeginImageContextWithOptions(backingSize, parameters.opaque, 1.0);
|
||||
|
||||
// if view is opaque, fill the context with background color
|
||||
if (parameters.opaque && parameters.backgroundColor) {
|
||||
[parameters.backgroundColor setFill];
|
||||
[[UIBezierPath bezierPathWithRect:{ .size = backingSize }] fill];
|
||||
}
|
||||
|
||||
[image drawInRect:imageDrawRect];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user