Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils/svg/ #6

Closed
dlemm opened this issue Apr 11, 2022 · 7 comments
Closed

utils/svg/ #6

dlemm opened this issue Apr 11, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@dlemm
Copy link
Member

dlemm commented Apr 11, 2022

/core/utils/svg)/parse.html
Line: 103ff. seems not working as it should. It only works when every quote is a single quote except for the viewPort.

There is the error

executing "partials/utils/svg/parse.html" at <float $w2>: error calling float: unable to cast "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 371.05 477\"" of type string to float64

looks like the regex is broken.

@dlemm
Copy link
Member Author

dlemm commented Apr 12, 2022

Update: it seems that nor rounded numbers in the viewPort are a problem. Will check if we can transform the input of the calculation to make this work even if the numbers include a decimal point.

@bezoerb bezoerb self-assigned this Apr 13, 2022
@bezoerb
Copy link
Member

bezoerb commented Jun 8, 2022

@dlemm: can you post a failing svg?

@psolbach psolbach added the bug Something isn't working label Jun 13, 2022
@dlemm
Copy link
Member Author

dlemm commented Jul 14, 2022

Created a random burger menu icon. Important is the viewbox and the 35.5.

<svg id="burger" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 54 35.5">
  <defs>
    <style>.cls-1{fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:3px;}</style>
  </defs>
  <line class="cls-1" x1="1.5" y1="1.5" x2="52.5" y2="1.5"/>
  <line class="cls-1" x1="1.5" y1="17.75" x2="52.5" y2="17.75"/>
  <line class="cls-1" x1="1.5" y1="34" x2="52.5" y2="34"/>
</svg>

@dlemm
Copy link
Member Author

dlemm commented Jul 14, 2022

when it's just 35 it works but with 35.5 it get's the above error (with the stats from the svg)

@psolbach
Copy link
Member

psolbach commented Dec 5, 2022

Just ran into this again. Let's prioritize this task.

@bezoerb
Copy link
Member

bezoerb commented Dec 6, 2022

Added a PR with a fix.
Sorry for the late response :)

@dlemm
Copy link
Member Author

dlemm commented Jan 2, 2023

I think this can be closed then?

@bezoerb bezoerb closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants