From 37e861817b0ae6e262fd604a74030f716997b88d Mon Sep 17 00:00:00 2001 From: Ali <> Date: Sun, 29 Oct 2023 23:40:32 +0400 Subject: [PATCH] Fix raster template emoji --- .../Sources/LottieAnimationCache.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/submodules/TelegramUI/Components/LottieAnimationCache/Sources/LottieAnimationCache.swift b/submodules/TelegramUI/Components/LottieAnimationCache/Sources/LottieAnimationCache.swift index 21265ad2fa..f6980ebb25 100644 --- a/submodules/TelegramUI/Components/LottieAnimationCache/Sources/LottieAnimationCache.swift +++ b/submodules/TelegramUI/Components/LottieAnimationCache/Sources/LottieAnimationCache.swift @@ -70,11 +70,12 @@ public func cacheStillSticker(path: String, width: Int, height: Int, writer: Ani UIGraphicsPushContext(c) if let customColor = customColor { + c.clip(to: CGRect(origin: CGPoint(), size: context.size), mask: image.cgImage!) 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() } memcpy(surface.argb, context.bytes, surface.height * surface.bytesPerRow)