Question: why are numerical values typed as int?
For example the signature of Rect is:
Rect(x int, y int, w int, h int, s ...string)
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.
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
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?