SwiftSVG icon indicating copy to clipboard operation
SwiftSVG copied to clipboard

Image is displayed way too big

Open Schnodderbalken opened this issue 5 years ago • 1 comments

Description of the Issue I have an SVG image which I load from a URL and position with programmatically with translatesAutoresizingMaskIntoConstraints = false and NSLayoutConstraints. If I use a usual UIImageView (with a static rendered image) then everything is fine. Using an SVGView creates the mentioned problem (see screenshot below).

Sample SVG https://www.patavinus.com/static/images/company-logos/5/logo.svg

Screenshots Using SVGView: https://pasteboard.co/ICdMugc.png Using UIImageView: https://pasteboard.co/ICdMPfA.png

Schnodderbalken avatar Oct 16 '19 10:10 Schnodderbalken

@Schnodderbalken did you try setting boundingBox to your SVGView object? eg. let svgView = UIView(URL: url) { (svgLayer) in svgLayer.boundingBox = CGRect(x: 0, y: 0, width: 300, height: 300) }

Sebulec avatar Oct 24 '19 12:10 Sebulec