1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-19 08:57:35 +03:00

Update formatting

This commit is contained in:
Yuri Strot 2018-06-28 17:27:16 +07:00
parent 4378c84ac3
commit 1ea58f334e
2 changed files with 6 additions and 4 deletions

View File

@ -20,7 +20,7 @@ open class AspectRatio {
}
internal class DoNothingAspectRatio: AspectRatio {
override func fit(size: Size, into sizeToFitIn: Size) -> Size {
return size
}

View File

@ -124,7 +124,7 @@ open class SVGParser {
if element.allAttributes["width"] == nil && element.allAttributes["height"] == nil && element.allAttributes["viewBox"] == nil {
return .none
}
let w = getDimensionValue(element, attribute: "width") ?? SVGLength(percent: 100)
let h = getDimensionValue(element, attribute: "height") ?? SVGLength(percent: 100)
let svgSize = SVGSize(width: w, height: h)
@ -570,7 +570,7 @@ open class SVGParser {
if let fillOpacity = styleParts["fill-opacity"] {
opacity = Double(fillOpacity.replacingOccurrences(of: " ", with: "")) ?? 1
}
guard var fillColor = styleParts["fill"] else {
return Color.black.with(a: opacity)
}
@ -1394,7 +1394,9 @@ open class SVGParser {
if let clipPath = attributes["clip-path"], let id = parseIdFromUrl(clipPath) {
if let userSpaceLocus = defClip[id] {
if !userSpaceLocus.userSpace {
guard let locus = locus else { return .none }
guard let locus = locus else {
return .none
}
let transform = transformBoundingBoxLocus(respectiveLocus: userSpaceLocus.locus, absoluteLocus: locus)
return TransformedLocus(locus: userSpaceLocus.locus, transform: transform)
}