mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Fix raster template emoji
This commit is contained in:
@@ -70,11 +70,12 @@ public func cacheStillSticker(path: String, width: Int, height: Int, writer: Ani
|
|||||||
UIGraphicsPushContext(c)
|
UIGraphicsPushContext(c)
|
||||||
|
|
||||||
if let customColor = customColor {
|
if let customColor = customColor {
|
||||||
|
c.clip(to: CGRect(origin: CGPoint(), size: context.size), mask: image.cgImage!)
|
||||||
c.setFillColor(customColor.cgColor)
|
c.setFillColor(customColor.cgColor)
|
||||||
c.setBlendMode(.sourceIn)
|
c.fill(CGRect(origin: CGPoint(), size: context.size))
|
||||||
|
} else {
|
||||||
|
c.draw(image.cgImage!, in: CGRect(origin: CGPoint(), size: context.size))
|
||||||
}
|
}
|
||||||
|
|
||||||
c.draw(image.cgImage!, in: CGRect(origin: CGPoint(), size: context.size))
|
|
||||||
UIGraphicsPopContext()
|
UIGraphicsPopContext()
|
||||||
}
|
}
|
||||||
memcpy(surface.argb, context.bytes, surface.height * surface.bytesPerRow)
|
memcpy(surface.argb, context.bytes, surface.height * surface.bytesPerRow)
|
||||||
|
|||||||
Reference in New Issue
Block a user