Skip to content

Conversation

rcancro
Copy link
Contributor

@rcancro rcancro commented May 26, 2023

I was using the commandline tool to convert svg icons to SF Symbols. There were a few examples where the height of the icon is less than its width, causing the computation of the scale in Renderer.SFSymbol.swift makeTransformation to be too large. This resulted in the width of the symbol being incorrect.

I have included one of the icon svg tiles (dash.svg) and a test to make sure the bounds are computed properly. I’m not sure if this is the proper fix, but a repro step is very easy. Simply run:

SwiftDraw dash.svg —format sfsymbol

Here is the input file:
dash

Here is the SF Symbol file before this patch:
dash-symbol-broken

And here is the SF Symbol file afterwards:
dash-symbol

I was using the commandline tool to convert svg icons to SF Symbols. There were a few examples where the height of the icon is less than its width, causing the computation of the scale in `Renderer.SFSymbol.swift` `makeTransformation` to be too large. This resulted in the width of the symbol being incorrect.

I have included one of the icon svg tiles (dash.svg) and a test to make sure the bounds are computed properly. I’m not sure if this is the proper fix, but a repro step is very easy. Simply run:

```
SwiftDraw dash.svg —format sfsymbol
```
Copy link
Owner

@swhitty swhitty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you.

🙏🏻 Much appreciated.

@codecov
Copy link

codecov bot commented May 27, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d803751) 85.36% compared to head (ecd3be1) 85.36%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #20   +/-   ##
=======================================
  Coverage   85.36%   85.36%           
=======================================
  Files          77       77           
  Lines        7009     7009           
=======================================
  Hits         5983     5983           
  Misses       1026     1026           
Impacted Files Coverage Δ
SwiftDraw/Renderer.SFSymbol.swift 83.54% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@swhitty swhitty merged commit a13c3ae into swhitty:main May 27, 2023
@swhitty
Copy link
Owner

swhitty commented May 27, 2023

0.14.0 includes the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants