You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function, like all other ones, declare int as parameter type. Why? Computation of point coordinates is usually done with floats, why does the library forces to lose precision when using these convenience functions?
I know I can use Path instead and format the d attribute however I like, but it's very inconvenient.
Can someone shed light on this design decision?
Thank you.
The text was updated successfully, but these errors were encountered:
That was an early design decision. If you want floats you can use "github.com/ajstarks/svgo/float" or better yet "github.com/ajstarks/gensvg"
The Path function is used a fallback when the higher level functions for example like the various Bezier curves are not sufficient
@ajstarks Thanks ive changed to github.com/ajstarks/svgo/float. I make SVG map overlays by converting lat lng to floats and i was loosing precision by being forced into integers. Maybe some documentation about its existance on the readme could help.
curious as to why you say "better yet" to "github.com/ajstarks/gensvg". Looks almost identical to this package, is there any difference between that package and this one?
For example the signature of
Rect
is:This function, like all other ones, declare
int
as parameter type. Why? Computation of point coordinates is usually done with floats, why does the library forces to lose precision when using these convenience functions?I know I can use
Path
instead and format thed
attribute however I like, but it's very inconvenient.Can someone shed light on this design decision?
Thank you.
The text was updated successfully, but these errors were encountered: