Category : transform

I am flipping canvas using image click. When I clicked on image nothing event listener called but canvas did not flipped but when I clicked twice canvas flipped. canvas = document.getElementById(‘canvas’); ctx = canvas.getContext(‘2d’); imgClicked?.addEventListener("click", function () { img = new Image(); img.src = canvas.toDataURL(); var flipH = document.getElementById(‘leftRightIp’).checked, flipV = document.getElementById(‘topDownIp’).checked; flipImage(img, ctx, flipH, ..

Read more