Open omkelderman opened 4 years ago
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
Great idea @omkelderman. I would certainly benefit from having this option.
I had a need to get both the metrics and the SVG string at the same time. Now I could have just called
getSVG
andgetMetrics
in my code and be done with it, but I noticed thatgetSVG
actually usedgetMetrics
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.