cloudhead / rx

👾 Modern and minimalist pixel editor
https://discord.gg/xHggPjfsS9
GNU General Public License v3.0
3.07k stars 109 forks source link

SVG output bug? #128

Closed Euphrasiologist closed 7 months ago

Euphrasiologist commented 2 years ago

So I want to export my pixel art as a SVG. I used

:export @10x test.svg

But inspecting the SVG there is no output. I think the y-scaling is off? I believe this line:

https://github.com/cloudhead/rx/blob/e0da197e8c20dbfcf7eff05f715c8925e880c5af/src/view/resource.rs#L302

To be the source of the issue? I replaced this line with:

...
fn round_down(num: u32, divisor: u32) -> u32 {
                num - (num % divisor)
            }

let y = round_down((i as u32 / h), scale);
...

It's not quite right (some of the pixels I was exporting jump around), but perhaps along the right lines...

cloudhead commented 2 years ago

Have you tried exporting at 1x?

cloudhead commented 7 months ago

Should be fixed in 1bcbe90527ad0bb89c99cec40667f6b961ec8d9e