flother / spreet

Create a spritesheet from a set of SVG images
MIT License
81 stars 4 forks source link

Avoid multiple hash lookups #71

Closed nyurik closed 10 months ago

nyurik commented 11 months ago

This is a rework based on #72 - it removes many hash lookups and clones, and instead uses one struct to keep all the relevant data. The #72 contains some of the changes this PR used to have, and it can be merged as is without waiting.

Note that until #72 is merged, this PR will continue to show all changes from both PRs

nyurik commented 11 months ago

Actually, I think this should be solved differently -- its weird to use a cloned String as a key, with constant lookups, where all you want is a ref to your own struct. I created https://github.com/ChevyRay/crunch-rs/pull/5 - with it it should be far easier to do this in a cleaner way

flother commented 11 months ago

Sounds good — do you want to leave this PR open and wait for the upstream PR to be merged?

nyurik commented 11 months ago

I pushed a new revision that uses the proposed upstream change. I may submit another PR that adapts some of the non-breaking changes, but lets keep this open once upstream merges (and so that you can review it)

nyurik commented 11 months ago

Silly me, all this was possible to do without the upstream changes

nyurik commented 11 months ago

On top of it, it turns out the per-sheet pixel ratio was never used, removed

nyurik commented 11 months ago

@flother any thoughts? thx!

flother commented 10 months ago

As with #73, merging #72 has caused a trivial conflict

nyurik commented 10 months ago

rebased