Fix flipped static emoji

This commit is contained in:
Ali 2022-07-13 12:11:08 +02:00
parent e70df961e1
commit 794d415e7d

View File

@ -33,7 +33,7 @@ public func cacheStillSticker(path: String, width: Int, height: Int, writer: Ani
if let data = try? Data(contentsOf: URL(fileURLWithPath: path)), let image = WebP.convert(fromWebP: data) {
writer.add(with: { surface in
let context = DrawingContext(size: CGSize(width: CGFloat(surface.width), height: CGFloat(surface.height)), scale: 1.0, opaque: false, clear: true, bytesPerRow: surface.bytesPerRow)
context.withContext { c in
context.withFlippedContext { c in
UIGraphicsPushContext(c)
c.draw(image.cgImage!, in: CGRect(origin: CGPoint(), size: context.size))
UIGraphicsPopContext()