mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Make DrawingContext initializer failable
This commit is contained in:
parent
59e2c74d42
commit
f07c30bd5b
39 changed files with 624 additions and 415 deletions
|
|
@ -88,7 +88,7 @@ final class ImageBasedPasscodeBackground: PasscodeBackground {
|
|||
self.size = size
|
||||
|
||||
let contextSize = size.aspectFilled(CGSize(width: 320.0, height: 320.0))
|
||||
let foregroundContext = DrawingContext(size: contextSize, scale: 1.0)
|
||||
let foregroundContext = DrawingContext(size: contextSize, scale: 1.0)!
|
||||
let bounds = CGRect(origin: CGPoint(), size: contextSize)
|
||||
|
||||
let filledImageSize = image.size.aspectFilled(contextSize)
|
||||
|
|
@ -109,7 +109,7 @@ final class ImageBasedPasscodeBackground: PasscodeBackground {
|
|||
}
|
||||
self.foregroundImage = foregroundContext.generateImage()!
|
||||
|
||||
let backgroundContext = DrawingContext(size: contextSize, scale: 1.0)
|
||||
let backgroundContext = DrawingContext(size: contextSize, scale: 1.0)!
|
||||
backgroundContext.withFlippedContext { c in
|
||||
c.interpolationQuality = .medium
|
||||
c.draw(image.cgImage!, in: filledImageRect)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue