This commit is contained in:
Isaac
2024-05-18 11:22:53 +04:00
parent 5545bdd978
commit 8b20aea99b
12 changed files with 50 additions and 91 deletions

View File

@@ -802,11 +802,14 @@ final class ChatSendMessageContextScreenComponent: Component {
}
let standaloneReactionAnimation: AnimatedStickerNode
var effectiveScale: CGFloat = 1.0
#if targetEnvironment(simulator)
standaloneReactionAnimation = DirectAnimatedStickerNode()
effectiveScale = 1.4
#else
if "".isEmpty {
standaloneReactionAnimation = DirectAnimatedStickerNode()
effectiveScale = 1.4
} else {
standaloneReactionAnimation = LottieMetalAnimatedStickerNode()
}
@@ -823,7 +826,7 @@ final class ChatSendMessageContextScreenComponent: Component {
let pathPrefix = component.context.account.postbox.mediaBox.shortLivedResourceCachePathPrefix(customEffectResource.id)
let source = AnimatedStickerResourceSource(account: component.context.account, resource: customEffectResource, fitzModifier: nil)
standaloneReactionAnimation.setup(source: source, width: Int(effectSize.width), height: Int(effectSize.height), playbackMode: .once, mode: .direct(cachePathPrefix: pathPrefix))
standaloneReactionAnimation.setup(source: source, width: Int(effectSize.width * effectiveScale), height: Int(effectSize.height * effectiveScale), playbackMode: .once, mode: .direct(cachePathPrefix: pathPrefix))
standaloneReactionAnimation.completed = { [weak self, weak standaloneReactionAnimation] _ in
guard let self else {
return