mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
27a3472171
commit_hash:84ea24cbdf21ef89741080f38ec5e583172a2458
35 lines
796 B
Swift
35 lines
796 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)
|
|
}
|
|
}
|
|
}
|