mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various improvements
This commit is contained in:
@@ -28,6 +28,8 @@ private func makeEntityView(context: AccountContext, entity: DrawingEntity) -> D
|
||||
return DrawingMediaEntityView(context: context, entity: entity)
|
||||
} else if let entity = entity as? DrawingLocationEntity {
|
||||
return DrawingLocationEntityView(context: context, entity: entity)
|
||||
} else if let entity = entity as? DrawingLinkEntity {
|
||||
return DrawingLinkEntityView(context: context, entity: entity)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
@@ -54,6 +56,9 @@ private func prepareForRendering(entityView: DrawingEntityView) {
|
||||
if let entityView = entityView as? DrawingLocationEntityView {
|
||||
entityView.entity.renderImage = entityView.getRenderImage()
|
||||
}
|
||||
if let entityView = entityView as? DrawingLinkEntityView {
|
||||
entityView.entity.renderImage = entityView.getRenderImage()
|
||||
}
|
||||
}
|
||||
|
||||
public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
||||
@@ -384,6 +389,14 @@ public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
||||
location.width = floor(self.size.width * 0.85)
|
||||
location.scale = zoomScale
|
||||
}
|
||||
} else if let location = entity as? DrawingLinkEntity {
|
||||
location.position = center
|
||||
if setup {
|
||||
location.rotation = rotation
|
||||
location.referenceDrawingSize = self.size
|
||||
location.width = floor(self.size.width * 0.85)
|
||||
location.scale = zoomScale
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user