exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.01k stars 554 forks source link

ContentMode not working for some SVGs #657

Closed GDGapps closed 4 years ago

GDGapps commented 4 years ago

Hello,

ContentMode does not work for some svg, for example "worldLow". Regardless of what I choose, it is always shown as very small in the center-left.

I have attached one svg in which it does not work for reference. Thanks worldLow.svg.zip

GDGapps commented 4 years ago

I noticed the issue is solved if I remove the dimension and viewbox attributes from the SVG

f3dm76 commented 4 years ago

Hello @GDGapps, this happens cause the extra "blank" space is included into this svg's viewBox. You can easily check this by setting a background color for the root item:

Screenshot 2020-06-03 at 16 20 54

We do not modify viewBoxes, since it is a part of the scene. Indeed if you were to remove the viewBox entirely, it would work as you expect it.

icearith commented 2 years ago

any progress on this "contentMode" issue?