From 80e9bf6b06911ba203a14dabcc7a385cd5b2ff38 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Sat, 22 Nov 2025 20:47:16 +0000 Subject: [PATCH] some bad code --- StickerSlack/Emoji/Emoji.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/StickerSlack/Emoji/Emoji.swift b/StickerSlack/Emoji/Emoji.swift index d975e7f..04c4a9c 100644 --- a/StickerSlack/Emoji/Emoji.swift +++ b/StickerSlack/Emoji/Emoji.swift @@ -111,6 +111,18 @@ struct Emoji: Codable, Identifiable, Hashable { } let rect = CGRect(origin: .zero, size: newSize) + + if let frames = image.images { + var result: [UIImage] = [] + for frame in frames { + UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0) + frame.draw(in: rect) + result.append(UIGraphicsGetImageFromCurrentImageContext() ?? UIImage()) + UIGraphicsEndImageContext() + } + return UIImage.animatedImage(with: result, duration: image.duration) ?? UIImage() + } + UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0) image.draw(in: rect) return UIGraphicsGetImageFromCurrentImageContext() ?? UIImage()