oslllo / svg-fixer

Converts SVG Strokes To Fill.
https://docs-oslllo-com.onrender.com/svg-fixer/master
MIT License
213 stars 19 forks source link

Outputs incorrect svg data when source svg has 'px', 'rem' or 'em' on height and width attributes as a unit of measurement. #5

Closed Ghustavh97 closed 4 years ago

Ghustavh97 commented 4 years ago

Example

Source svg

<svg class="bi bi-archive-fill" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
  <path fill-rule="evenodd" d="M12.643 15C13.979 15 15 13.845 15 12.5V5H1v7.5C1 13.845 2.021 15 3.357 15h9.286zM6 7a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1H6zM.8 1a.8.8 0 0 0-.8.8V3a.8.8 0 0 0 .8.8h14.4A.8.8 0 0 0 16 3V1.8a.8.8 0 0 0-.8-.8H.8z"/>
</svg>

Outputs

Expected SVG Produced SVG
expected result

This is also true when height and width are in px or rem as well.

Ghustavh97 commented 4 years ago

Fixed in https://github.com/oslllo/svg-fixer/pull/6