SDWebImageSVGCoder
SDWebImageSVGCoder copied to clipboard
SwiftUI SVG -> WebImage Inconsistencies
This coder was super easy to add which was awesome right off the bat, but I'm seeing some issues with most SVG's I try drawing.
Would love some help if I'm doing something wrong. Examples below.
SwiftUI code used:
WebImage(url: URL(string: "https://storage.opensea.io/files/30cdec8b3f25da72e82bba1c36c23fa6.svg")!, context: [.imageThumbnailPixelSize: CGSize.zero])
.resizable()
.scaledToFit()
.border(Color.gray)
Example 1:
SVG url: https://storage.opensea.io/files/30cdec8b3f25da72e82bba1c36c23fa6.svg
Output:

Issue:
This SVG is just a colored square, so ideally it should fill the entire frame of the WebImage. Instead it's only occupying a small portion.
Example 2:
SVG url: https://storage.opensea.io/files/0a551bef6cba9c8af017420aafe7657a.svg
Output:

Issue: The text inside the SVG is not centered.
Can provide more examples if needed. Also happy to create a pull request to the coder if I could get a little guidance on the nature of the issues(s)
Thank you!