Files
divkit/client/ios/DivKit/Extensions/DivDrawable/DivDrawableExtensions.swift
T
pkurchatov 6d4e785be4 Applied Swift 5.9 format
7efc9a489061fda48036f567437a3d692591ff4a
2024-02-27 10:59:51 +03:00

36 lines
809 B
Swift

import CoreGraphics
import CommonCorePublic
import LayoutKit
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)
}
}
}