3 ms·
Why are the SVG tiles specified to 599.99999999 instead of 600 or something? I think a SVGO optimizations run would reduce the size of the assets a tad.
by ranman 4y ago
Why are the SVG tiles specified to 599.99999999 instead of 600 or something? I think a SVGO optimizations run would reduce the size of the assets a tad.
- Etheryte 4y agoI would guess that the assets were made in Inkscape or comparable software where you work visually and don't actually look at the generated code.
- gereleth 4y agoThere aren't really any assets though. I just create the svgs dynamically. Maybe I need to place some strategic `Math.round` calls here and there, never thought of this =).
- ranman 4y agoYeah so if you can math.round or math.floor them a bit the paths are a lot cleaner - if you're dynamically creating them anyway though then I don't know that it gains you much performance. It might gain some performance on render for larger maps? Not sure. Didn't get a chance to look at your source.
- gereleth 4y agoThe file to look at would be this Tile component: https://github.com/gereleth/hexapipes/blob/main/src/lib/puzzle/Tile.svelte https://github.com/gereleth/hexapipes/blob/main/src/lib/puzz... My svg handling was very much "learn as I go". An earlier version even had circles instead of hexagons because they're simpler to do. There's a cool playthrough video of that version: https://www.youtube.com/watch?v=vlpPr485NUY https://www.youtube.com/watch?v=vlpPr485NUY