mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[WIP] Stickers editor
This commit is contained in:
@@ -959,6 +959,7 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode {
|
||||
|
||||
let backgroundFrame = CGRect(origin: CGPoint(x: backgroundInsets.left, y: backgroundInsets.top), size: CGSize(width: actualSize.width - backgroundInsets.left - backgroundInsets.right, height: actualSize.height - backgroundInsets.top - backgroundInsets.bottom))
|
||||
var patternTopRightPosition = CGPoint()
|
||||
var patternAlpha: CGFloat = 1.0
|
||||
|
||||
if !contentAnimatedFilesValue.isEmpty, let (_, inlineMediaSize) = inlineMediaAndSize {
|
||||
var inlineMediaFrame = CGRect(origin: CGPoint(x: actualSize.width - insets.right - inlineMediaSize.width, y: backgroundInsets.top + inlineMediaEdgeInset), size: inlineMediaSize)
|
||||
@@ -966,8 +967,8 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode {
|
||||
inlineMediaFrame.origin.x = insets.left
|
||||
}
|
||||
|
||||
patternTopRightPosition.x = insets.right + inlineMediaSize.width - 6.0
|
||||
|
||||
patternAlpha = 0.5
|
||||
|
||||
if !contentAnimatedFilesValue.isEmpty {
|
||||
if contentAnimatedFilesValue.count < 4, let file = contentAnimatedFilesValue.first {
|
||||
let stickerLayer: InlineStickerItemLayer
|
||||
@@ -1486,13 +1487,13 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode {
|
||||
if let current = self.backgroundView {
|
||||
backgroundView = current
|
||||
animation.animator.updateFrame(layer: backgroundView.layer, frame: backgroundFrame, completion: nil)
|
||||
backgroundView.update(size: backgroundFrame.size, isTransparent: false, primaryColor: mainColor, secondaryColor: secondaryColor, thirdColor: tertiaryColor, backgroundColor: nil, pattern: pattern, patternTopRightPosition: patternTopRightPosition, animation: animation)
|
||||
backgroundView.update(size: backgroundFrame.size, isTransparent: false, primaryColor: mainColor, secondaryColor: secondaryColor, thirdColor: tertiaryColor, backgroundColor: nil, pattern: pattern, patternTopRightPosition: patternTopRightPosition, patternAlpha: patternAlpha, animation: animation)
|
||||
} else {
|
||||
backgroundView = MessageInlineBlockBackgroundView()
|
||||
self.backgroundView = backgroundView
|
||||
backgroundView.frame = backgroundFrame
|
||||
self.transformContainer.view.insertSubview(backgroundView, at: 0)
|
||||
backgroundView.update(size: backgroundFrame.size, isTransparent: false, primaryColor: mainColor, secondaryColor: secondaryColor, thirdColor: tertiaryColor, backgroundColor: nil, pattern: pattern, patternTopRightPosition: patternTopRightPosition, animation: .None)
|
||||
backgroundView.update(size: backgroundFrame.size, isTransparent: false, primaryColor: mainColor, secondaryColor: secondaryColor, thirdColor: tertiaryColor, backgroundColor: nil, pattern: pattern, patternTopRightPosition: patternTopRightPosition, patternAlpha: patternAlpha, animation: .None)
|
||||
}
|
||||
} else {
|
||||
if let backgroundView = self.backgroundView {
|
||||
|
||||
Reference in New Issue
Block a user