abey79 / vsvg

Fast and portable tools for plotter users
http://whisk.rs
MIT License
107 stars 12 forks source link

Change `HexGrid::spacing()` to accept a single scalar and maintain hexagonal grid #72

Closed karliss closed 8 months ago

karliss commented 8 months ago

Keep the hexagons placed within hexagon grid when setting spacing. Previous version placed them in rectangular grid.

Note that it does change the argument type for spacing function arguments from [f64; 2] to f64 it is still possible to set separate spacing for vertical and horizontal spacing using horizontal_spacing and vertical_spacing functions.

If you want to maintain old function signature I don't mind changing using different approach.

abey79 commented 8 months ago

This looks good to me, though I'd be interested in @afternoon2's take as they're the initial implementer if this feature.

afternoon2 commented 8 months ago

lgtm! 🚀