fix: clear canvas before flip

This commit is contained in:
httpjamesm 2023-10-15 13:32:30 -04:00
parent bdedc16ab5
commit 7b67610f22
No known key found for this signature in database

View file

@ -100,6 +100,8 @@ const TransformMenu = () => {
img.src = canvas.toDataURL();
img.onload = () => {
context.clearRect(0, 0, canvas.width, canvas.height);
context.save();
if (direction === 'vertical') {
@ -109,6 +111,7 @@ const TransformMenu = () => {
context.translate(0, canvas.height);
context.scale(1, -1);
}
context.drawImage(img, 0, 0, canvas.width, canvas.height);
context.restore();