这样写和讲的不一样会有什么漏洞吗?
function drawImageByScale(scale){
var imageWidth=canvas.width*scale;
var imageHeight=canvas.height*scale;
var width=(canvas.width-imageWidth)/2;
var height=(canvas.height-imageHeight)/2;
context.drawImage(img,0,0,canvas.width,canvas.height,width,height,imageWidth,imageHeight);
alert(sx);
alert(sy);
}