mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various improvements
This commit is contained in:
@@ -7,6 +7,7 @@ import AccountContext
|
||||
import MediaEditor
|
||||
import ComponentFlow
|
||||
import LottieAnimationComponent
|
||||
import ReactionSelectionNode
|
||||
|
||||
public func decodeDrawingEntities(data: Data) -> [DrawingEntity] {
|
||||
if let codableEntities = try? JSONDecoder().decode([CodableDrawingEntity].self, from: data) {
|
||||
@@ -36,6 +37,9 @@ private func makeEntityView(context: AccountContext, entity: DrawingEntity) -> D
|
||||
}
|
||||
|
||||
private func prepareForRendering(entityView: DrawingEntityView) {
|
||||
if let entityView = entityView as? DrawingStickerEntityView {
|
||||
entityView.entity.renderImage = entityView.getRenderImage()
|
||||
}
|
||||
if let entityView = entityView as? DrawingBubbleEntityView {
|
||||
entityView.entity.renderImage = entityView.getRenderImage()
|
||||
}
|
||||
@@ -70,6 +74,8 @@ public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
||||
public var getEntityInitialRotation: () -> CGFloat = { return 0.0 }
|
||||
public var getEntityAdditionalScale: () -> CGFloat = { return 1.0 }
|
||||
|
||||
public var getAvailableReactions: () -> [ReactionItem] = { return [] }
|
||||
|
||||
public var hasSelectionChanged: (Bool) -> Void = { _ in }
|
||||
var selectionChanged: (DrawingEntity?) -> Void = { _ in }
|
||||
var requestedMenuForEntityView: (DrawingEntityView, Bool) -> Void = { _, _ in }
|
||||
@@ -654,6 +660,8 @@ public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
} else if let stickerEntityView = selectedEntityView as? DrawingStickerEntityView {
|
||||
stickerEntityView.onDeselection()
|
||||
}
|
||||
|
||||
self.selectedEntityView = nil
|
||||
|
||||
Reference in New Issue
Block a user