Various improvements

This commit is contained in:
Ilya Laktyushin
2024-07-13 18:13:58 +04:00
parent 3134a4ef1b
commit 4216ee3933
125 changed files with 4969 additions and 1474 deletions

View File

@@ -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
}
}
}