cloudhead / rx

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

Do not panic when doing f/resize #29

Closed kstrafe closed 4 years ago

kstrafe commented 4 years ago

How to reproduce: Move the cursor to the top-right quadrant of the 128 128 image. Run :f/resize 1 1, run :f/resize 128 128

This would cause an underflow in the color_at function.

The test case does not reproduce the bug so I'd like some help with that. Overall this library needs more testing.

cloudhead commented 4 years ago

As for the reason the tests are passing - it's because the renderer creates the snapshots from the framebuffer - so in that test this isn't happening and thus the snapshot is always the initial 128x128 one. I'd suggest removing the tests for now, as there will be a much more comprehensive way of testing things soon.

kstrafe commented 4 years ago

@cloudhead alright, test removed.

cloudhead commented 4 years ago

Thanks!