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:
@@ -30,6 +30,8 @@ private func makeEntityView(context: AccountContext, entity: DrawingEntity) -> D
|
||||
return DrawingLocationEntityView(context: context, entity: entity)
|
||||
} else if let entity = entity as? DrawingLinkEntity {
|
||||
return DrawingLinkEntityView(context: context, entity: entity)
|
||||
} else if let entity = entity as? DrawingWeatherEntity {
|
||||
return DrawingWeatherEntityView(context: context, entity: entity)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
@@ -59,6 +61,9 @@ private func prepareForRendering(entityView: DrawingEntityView) {
|
||||
if let entityView = entityView as? DrawingLinkEntityView {
|
||||
entityView.entity.renderImage = entityView.getRenderImage()
|
||||
}
|
||||
if let entityView = entityView as? DrawingWeatherEntityView {
|
||||
entityView.entity.renderImage = entityView.getRenderImage()
|
||||
}
|
||||
}
|
||||
|
||||
public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
||||
@@ -397,6 +402,14 @@ public final class DrawingEntitiesView: UIView, TGPhotoDrawingEntitiesView {
|
||||
location.width = floor(self.size.width * 0.85)
|
||||
location.scale = zoomScale
|
||||
}
|
||||
} else if let weather = entity as? DrawingWeatherEntity {
|
||||
weather.position = center
|
||||
if setup {
|
||||
weather.rotation = rotation
|
||||
weather.referenceDrawingSize = self.size
|
||||
weather.width = floor(self.size.width * 0.85)
|
||||
weather.scale = zoomScale
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user