mirror of
https://github.com/exyte/Macaw.git
synced 2024-09-11 13:15:35 +03:00
#344 rename root to canvas
This commit is contained in:
parent
c1d03ac607
commit
5e731da95b
@ -192,13 +192,13 @@ open class SVGParser {
|
|||||||
guard let layout = try parseViewBox(element), let group = try parseGroup(node, style: groupStyle) else {
|
guard let layout = try parseViewBox(element), let group = try parseGroup(node, style: groupStyle) else {
|
||||||
return .none
|
return .none
|
||||||
}
|
}
|
||||||
let root = SVGCanvas(layout: layout, contents: group.contents)
|
let canvas = SVGCanvas(layout: layout, contents: group.contents)
|
||||||
if let opacity = element.attribute(by: "opacity") {
|
if let opacity = element.attribute(by: "opacity") {
|
||||||
root.opacity = getOpacity(opacity.text)
|
canvas.opacity = getOpacity(opacity.text)
|
||||||
}
|
}
|
||||||
return root
|
return canvas
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate func parseViewBox(_ element: SWXMLHash.XMLElement) throws -> SVGNodeLayout? {
|
fileprivate func parseViewBox(_ element: SWXMLHash.XMLElement) throws -> SVGNodeLayout? {
|
||||||
if element.allAttributes["width"] == nil && element.allAttributes["height"] == nil && element.allAttributes["viewBox"] == nil {
|
if element.allAttributes["width"] == nil && element.allAttributes["height"] == nil && element.allAttributes["viewBox"] == nil {
|
||||||
return .none
|
return .none
|
||||||
|
Loading…
Reference in New Issue
Block a user