Skip to content

Commit

Permalink
Update indents
Browse files Browse the repository at this point in the history
  • Loading branch information
mnndnl committed Oct 4, 2021
1 parent cc7513b commit dfcfdbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Source/svg/CSSParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CSSParser {
return .byTag(text)
}

func getStyles(element: XMLHash.XMLElement) -> [String: String] {
func getStyles(element: XMLHash.XMLElement) -> [String: String] {
var styleAttributes = [String: String]()

if let styles = stylesByTag[element.name] {
Expand Down
26 changes: 13 additions & 13 deletions Source/svg/SVGParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ open class SVGParser {
}
let parsedXml = config.parse(xmlString)

var svgElement: XMLHash.XMLElement?
var svgElement: XMLHash.XMLElement?
for child in parsedXml.children {
if let element = child.element {
if element.name == "svg" {
Expand Down Expand Up @@ -203,7 +203,7 @@ open class SVGParser {
}
}

fileprivate func parseViewBox(_ element: XMLHash.XMLElement) throws -> SVGNodeLayout? {
fileprivate func parseViewBox(_ element: XMLHash.XMLElement) throws -> SVGNodeLayout? {
let widthAttributeNil = element.allAttributes["width"] == nil
let heightAttributeNil = element.allAttributes["height"] == nil
let viewBoxAttributeNil = element.allAttributes["viewBox"] == nil
Expand Down Expand Up @@ -508,7 +508,7 @@ open class SVGParser {
return Group(contents: groupNodes, place: getPosition(element), tag: getTag(element))
}

fileprivate func getPosition(_ element: XMLHash.XMLElement) -> Transform {
fileprivate func getPosition(_ element: XMLHash.XMLElement) -> Transform {
guard let transformAttribute = element.allAttributes["transform"]?.text else {
return Transform.identity
}
Expand Down Expand Up @@ -666,7 +666,7 @@ open class SVGParser {
}

fileprivate func getStyleAttributes(_ groupAttributes: [String: String],
element: XMLHash.XMLElement) -> [String: String] {
element: XMLHash.XMLElement) -> [String: String] {
var styleAttributes: [String: String] = groupAttributes

for (att, val) in styles.getStyles(element: element) {
Expand Down Expand Up @@ -896,7 +896,7 @@ open class SVGParser {
return 0
}

fileprivate func getTag(_ element: XMLHash.XMLElement) -> [String] {
fileprivate func getTag(_ element: XMLHash.XMLElement) -> [String] {
let id = element.allAttributes["id"]?.text
return id.map { [$0] } ?? []
}
Expand Down Expand Up @@ -1081,7 +1081,7 @@ open class SVGParser {
return Align.min
}

fileprivate func parseSimpleText(_ text: XMLHash.XMLElement,
fileprivate func parseSimpleText(_ text: XMLHash.XMLElement,
textAnchor: String?,
fill: Fill?,
stroke: Stroke?,
Expand Down Expand Up @@ -1156,7 +1156,7 @@ open class SVGParser {
baseline: .alphabetic,
place: place,
opacity: opacity)
} else if let tspanElement = element as? XMLHash.XMLElement,
} else if let tspanElement = element as? XMLHash.XMLElement,
tspanElement.name == "tspan" {
// parse as <tspan> element
// ultimately skip it if it cannot be parsed
Expand Down Expand Up @@ -1187,7 +1187,7 @@ open class SVGParser {
return collection
}

fileprivate func parseTspan(_ element: XMLHash.XMLElement,
fileprivate func parseTspan(_ element: XMLHash.XMLElement,
withWhitespace: Bool = false,
textAnchor: String?,
fill: Fill?,
Expand Down Expand Up @@ -1242,7 +1242,7 @@ open class SVGParser {
weight: getFontWeight(attributes) ?? fontWeight ?? "normal")
}

fileprivate func getTspanPosition(_ element: XMLHash.XMLElement,
fileprivate func getTspanPosition(_ element: XMLHash.XMLElement,
bounds: Rect,
previousCollectedTspan: Node?,
withWhitespace: inout Bool) -> Transform {
Expand Down Expand Up @@ -1653,14 +1653,14 @@ open class SVGParser {
return .none
}

fileprivate func getDoubleValue(_ element: XMLHash.XMLElement, attribute: String) -> Double? {
fileprivate func getDoubleValue(_ element: XMLHash.XMLElement, attribute: String) -> Double? {
guard let attributeValue = element.allAttributes[attribute]?.text else {
return .none
}
return doubleFromString(attributeValue)
}

fileprivate func getDimensionValue(_ element: XMLHash.XMLElement, attribute: String) -> SVGLength? {
fileprivate func getDimensionValue(_ element: XMLHash.XMLElement, attribute: String) -> SVGLength? {
guard let attributeValue = element.allAttributes[attribute]?.text else {
return .none
}
Expand Down Expand Up @@ -1701,7 +1701,7 @@ open class SVGParser {
}
}

fileprivate func getDoubleValueFromPercentage(_ element: XMLHash.XMLElement, attribute: String) -> Double? {
fileprivate func getDoubleValueFromPercentage(_ element: XMLHash.XMLElement, attribute: String) -> Double? {
guard let attributeValue = element.allAttributes[attribute]?.text else {
return .none
}
Expand All @@ -1716,7 +1716,7 @@ open class SVGParser {
return .none
}

fileprivate func getIntValue(_ element: XMLHash.XMLElement, attribute: String) -> Int? {
fileprivate func getIntValue(_ element: XMLHash.XMLElement, attribute: String) -> Int? {
if let attributeValue = element.allAttributes[attribute]?.text {
if let doubleValue = Double(attributeValue) {
return Int(doubleValue)
Expand Down

0 comments on commit dfcfdbe

Please sign in to comment.