1j01 / jspaint

🎨 Classic MS Paint, REVIVED + ✨Extras
https://jspaint.app/about
MIT License
7.17k stars 562 forks source link

Error while resizing selection buffer #278

Closed shynekomaid closed 2 years ago

shynekomaid commented 2 years ago

If you select an area and press the ctrl + NumPad - key combination to reduce the image in the area, then when its size reaches 0 an error will occur.

Error text:

InvalidStateError

Error: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.
    at OnCanvasSelection.scale (https://jspaint.app/src/OnCanvasSelection.js:277:25)
    at https://jspaint.app/src/app.js:1009:14
    at dispatch (https://jspaint.app/lib/jquery-3.4.1.min.js:2:42571)
    at v.handle (https://jspaint.app/lib/jquery-3.4.1.min.js:2:40572)
1j01 commented 2 years ago

Fixed. Thanks for reporting!