some bad code

This commit is contained in:
neon443
2025-11-22 20:47:16 +00:00
parent 7b9ba69127
commit 80e9bf6b06

View File

@@ -111,6 +111,18 @@ struct Emoji: Codable, Identifiable, Hashable {
} }
let rect = CGRect(origin: .zero, size: newSize) 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) UIGraphicsBeginImageContextWithOptions(newSize, false, 1.0)
image.draw(in: rect) image.draw(in: rect)
return UIGraphicsGetImageFromCurrentImageContext() ?? UIImage() return UIGraphicsGetImageFromCurrentImageContext() ?? UIImage()