-
Notifications
You must be signed in to change notification settings - Fork 563
Open
Description
Hi! I have a small project where I'm trying to open SVG image using Macaw library. In that project I make a SVGView and set its contentMode parameter to ".scaleAspectFit". As far as I know, the only condition for it to work is availability of "width" and "height" parameters in SVG XML. But it just doesn't work and the image is presented in its original scale
So, this is a code snippet where I create a view:
func makeUIView(context: Context) -> SVGView {
let node = try! SVGParser.parse(resource: svgName)
let svgView = SVGView(node: node, frame: CGRect(origin: CGPoint.zero, size: size))
svgView.backgroundColor = UIColor.white
svgView.contentMode = .scaleAspectFit
svgView.layer.borderWidth = 1.0
svgView.layer.borderColor = UIColor.white.cgColor
svgView.zoom.enable()
return svgView
}
and attached below is the image example from the project
Thanks in advance. Let me know if you need anything else.
svg-5.svg.zip
Metadata
Metadata
Assignees
Labels
No labels