Can you please help me troubleshoot why my image is not centered using the method below?
function drawImage() {
clear();
element.save();
element.scale(currentScale, currentScale);
element.rotate(currentAngle * Math.PI / 180);
element.drawImage(image, canvas.width/2-image.width/2, canvas.height/2-image.height/2);
element.restore();
}
Here is the code snippet: http://plnkr.co/edit/Tvika6ygEBGmR9OMLSaT?p=preview
Expected outcome: