diff --git a/submodules/DrawingUI/Sources/DrawingStickerEntity.swift b/submodules/DrawingUI/Sources/DrawingStickerEntity.swift index d9976fb3b7..813fb79951 100644 --- a/submodules/DrawingUI/Sources/DrawingStickerEntity.swift +++ b/submodules/DrawingUI/Sources/DrawingStickerEntity.swift @@ -33,7 +33,7 @@ public final class DrawingStickerEntityView: DrawingEntityView { private var outlineView: UIImageView? private let imageNode: TransformImageNode - private var animationNode: AnimatedStickerNode? + private var animationNode: DefaultAnimatedStickerNodeImpl? private var videoNode: UniversalVideoNode? private var didSetUpAnimationNode = false @@ -125,6 +125,24 @@ public final class DrawingStickerEntityView: DrawingEntityView { } } + private func updateAnimationColor() { + let color: UIColor? + if case let .file(file, type) = self.stickerEntity.content, file.isCustomTemplateEmoji { + if case let .reaction(_, style) = type { + if case .white = style { + color = UIColor(rgb: 0x000000) + } else { + color = UIColor(rgb: 0xffffff) + } + } else { + color = UIColor(rgb: 0xffffff) + } + } else { + color = nil + } + self.animationNode?.dynamicColor = color + } + private func setup() { if let file = self.file { if let dimensions = file.dimensions { @@ -149,9 +167,7 @@ public final class DrawingStickerEntityView: DrawingEntityView { } self.addSubnode(animationNode) - if file.isCustomTemplateEmoji { - animationNode.dynamicColor = UIColor(rgb: 0xffffff) - } + self.updateAnimationColor() if !self.stickerEntity.isAnimated { self.imageNode.isHidden = true @@ -639,6 +655,7 @@ public final class DrawingStickerEntityView: DrawingEntityView { self.outlineView?.tintColor = UIColor(rgb: 0x000000, alpha: 0.5) } } + self.updateAnimationColor() let isReaction = self.isReaction let staticTransform = CATransform3DMakeScale(self.stickerEntity.mirrored ? -1.0 : 1.0, 1.0, 1.0) diff --git a/submodules/TelegramUI/Components/MediaEditor/Sources/Drawing/DrawingStickerEntity.swift b/submodules/TelegramUI/Components/MediaEditor/Sources/Drawing/DrawingStickerEntity.swift index f36e0c4256..d18276e8d0 100644 --- a/submodules/TelegramUI/Components/MediaEditor/Sources/Drawing/DrawingStickerEntity.swift +++ b/submodules/TelegramUI/Components/MediaEditor/Sources/Drawing/DrawingStickerEntity.swift @@ -111,8 +111,12 @@ public final class DrawingStickerEntity: DrawingEntity, Codable { switch self.content { case let .image(image, _): dimensions = image.size - case let .file(file, _): - dimensions = file.dimensions?.cgSize ?? CGSize(width: 512.0, height: 512.0) + case let .file(file, type): + if case .reaction = type { + dimensions = CGSize(width: 512.0, height: 512.0) + } else { + dimensions = file.dimensions?.cgSize ?? CGSize(width: 512.0, height: 512.0) + } case let .video(file): dimensions = file.dimensions?.cgSize ?? CGSize(width: 512.0, height: 512.0) case .dualVideoReference: