Open Cruor opened 4 years ago
I think it's because the surface type is used for all surfaces and the vector surfaces like SVG and PDF are created in Float64 dimensions (https://www.cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-surface-create)
In that case it would probably be better to either have two separate types or to allow the type to accept either int or float values, not convert everything to float.
Does storing Float64 introduce problems in your code?
Having to convert between integers and floats a lot can be a minor performance issue when done a lot of times. And that kind of thing has to be done when doing maths involving exact pixels.
FWIW, I was about to ask the same thing before I saw this issue. The Real
and Float64
annotations made it harder for me to guess the purpose of those values, both investigating stuff at the REPL and when reading the code.
Is there a specific reason why they are stored as Float64s?. The documentation for Cairo uses integers for these. For example cairo-image-surface-get-height.