Files
divkit/client/ios/DivKit/Extensions/DivDrawable/DivDrawableExtensions.swift
T
denlvovich e001d74afe Update to VGSL6.0
4f8b5f480ade3f347d5f0a2d01a1618069bcb846
2024-07-12 20:33:42 +03:00

36 lines
797 B
Swift

import CoreGraphics
import LayoutKit
import VGSL
extension DivDrawable {
func makeBlock(
context: DivBlockModelingContext,
widthTrait: DivDrawableWidthTrait = .fixed,
corners: CGRect.Corners
) -> Block {
switch self {
case let .divShapeDrawable(shapeDrawable):
shapeDrawable.makeBlock(
context: context,
widthTrait: widthTrait,
corners: corners
)
}
}
func resolveWidth(_ context: DivBlockModelingContext) -> CGFloat {
switch self {
case let .divShapeDrawable(shapeDrawable):
shapeDrawable.resolveWidth(context)
}
}
func resolveHeight(_ context: DivBlockModelingContext) -> CGFloat {
switch self {
case let .divShapeDrawable(shapeDrawable):
shapeDrawable.resolveHeight(context)
}
}
}