Various improvements

This commit is contained in:
Ilya Laktyushin
2024-06-15 18:41:19 +04:00
parent 2150d65f78
commit 1ae20bd685
94 changed files with 3242 additions and 534 deletions

View File

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