func createElement()

in Cyborg/VectorDrawableParser.swift [389:409]


    func createElement() -> Result<VectorDrawable> {
        if let baseWidth = baseWidth,
            let baseHeight = baseHeight,
            let viewPortWidth = viewPortWidth,
            let viewPortHeight = viewPortHeight {
            return children.mapAllOrFail { group in
                group.createElement(in: CGSize(width: viewPortWidth, height: viewPortHeight))
            }
            .flatMap { (groups) -> Result<VectorDrawable> in
                .ok(.init(baseWidth: baseWidth,
                          baseHeight: baseHeight,
                          viewPortWidth: viewPortWidth,
                          viewPortHeight: viewPortHeight,
                          baseAlpha: alpha,
                          groups: groups,
                          autoMirrored: autoMirrored))
            }
        } else {
            return .error("Could not parse a <vector> element, but there was no error. This is a bug in the VectorDrawable Library.")
        }
    }