mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
12 lines
294 B
Swift
12 lines
294 B
Swift
import Foundation
|
|
|
|
extension DivAspect? {
|
|
func resolveAspectRatio(_ expressionResolver: ExpressionResolver) -> CGFloat? {
|
|
if let aspect = self, let ratio = aspect.resolveRatio(expressionResolver) {
|
|
// AspectBlock has inverted ratio
|
|
return 1 / ratio
|
|
}
|
|
return nil
|
|
}
|
|
}
|