mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
37 lines
905 B
Swift
37 lines
905 B
Swift
import Foundation
|
|
import CoreGraphics
|
|
import QuartzCore
|
|
|
|
final class MyImageCompositionLayer: MyCompositionLayer {
|
|
|
|
var image: CGImage? = nil {
|
|
didSet {
|
|
//NOTE
|
|
/*if let image = image {
|
|
contentsLayer.contents = image
|
|
} else {
|
|
contentsLayer.contents = nil
|
|
}*/
|
|
}
|
|
}
|
|
|
|
let imageReferenceID: String
|
|
|
|
init(imageLayer: ImageLayerModel, size: CGSize) {
|
|
self.imageReferenceID = imageLayer.referenceID
|
|
super.init(layer: imageLayer, size: size)
|
|
|
|
//NOTE
|
|
//contentsLayer.masksToBounds = true
|
|
//contentsLayer.contentsGravity = CALayerContentsGravity.resize
|
|
}
|
|
|
|
override func captureDisplayItem() -> CapturedGeometryNode.DisplayItem? {
|
|
preconditionFailure()
|
|
}
|
|
|
|
override func captureChildren() -> [CapturedGeometryNode] {
|
|
return []
|
|
}
|
|
}
|