You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.
@taschmidt This is just a convenient method for most use case, when you specify sd_adjustContentMode = YES, it try to modify the SVG DOM tree to adjust content fit.
Actually, you can keep sd_adjustContentMode = NO (by default it's NO). And adjust the SVGKImage DOM tree by your self.
For your cases, you can change the viewBox, but not the viewPort. You can change the viewport (x, y, w, h) -> (x - x1, y-y1, w, h), x1, y1 depends on your SVG's draw image code's offset X and Y.....
Actually, I'm not be expert on SVG spec. I just a normal user of SVGKit and provide this codec for SDWebImage. If you think this implementation has something wrong or better way to declare the syntax, PR is welcomed !
I tried messing with viewBox and viewport in the completion handler of sd_setImage and couldn't get it working so I reverted back to using SVGKit directly. One problem I had when messing with it in that handler was multiple SVG images composited on top of each other. I'm not sure if I was doing something wrong?
I'd like to load an SVG with aspect fit but I'd like it to draw top left rather than centered. In other words, skip this behavior:
https://github.com/SDWebImage/SDWebImageSVGCoder/blob/master/SDWebImageSVGCoder/Classes/SDWebImageSVGCoderDefine.m#L46
I tried setting the viewport to x:0 and y:0 in my completion block of sd_setImage but it doesn't appear to have any effect...?
The text was updated successfully, but these errors were encountered: