Skip to content

create a new function to combine getSVG and getMetrics #57

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

omkelderman
Copy link

I had a need to get both the metrics and the SVG string at the same time. Now I could have just called getSVG and getMetrics in my code and be done with it, but I noticed that getSVG actually used getMetrics internally so then it would be called twice.

So I thought why not expose a function to get them both at the same time in an efficient manner.
This change is entirely backwards compatible.

@omkelderman
Copy link
Author

hmm, I actually now just realized that the same can be done for getD and getPath, which also means that the current implementation of getSVG already calls getMetrics twice: once in getSVG itself and once in getD which gets called in getPath

This should be able to be optimised even more

@cmloegcmluin
Copy link

Great idea @omkelderman. I would certainly benefit from having this option.

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