Files
babaevmm 956c055cd8 update swiftformat, add organize rule
commit_hash:0f7ba811b37db6d2a9fc05efe5f94502feda4856
2025-08-04 16:24:48 +03:00

41 lines
771 B
Swift

import DivKit
import LayoutKit
import VGSL
public final class ImageExtensionHandler: DivExtensionHandler {
public let id: String
private let image: ImageHolder?
public init(
id: String,
image: ImageHolder?
) {
self.id = id
self.image = image
}
public func applyBeforeBaseProperties(
to block: Block,
div _: DivBase,
context _: DivBlockModelingContext
) -> Block {
guard
let block = block as? ImageBlock,
let image
else {
return block
}
return ImageBlock(
imageHolder: image,
widthTrait: block.widthTrait,
height: block.height,
contentMode: block.contentMode,
tintColor: block.tintColor,
tintMode: block.tintMode,
effects: block.effects
)
}
}