Commit e3f72e17 by doszhang

dos

parent aa95d194
...@@ -258,8 +258,6 @@ var init = function () { ...@@ -258,8 +258,6 @@ var init = function () {
} }
var drawImage = function () { var drawImage = function () {
if (uploadedImg) { if (uploadedImg) {
alert(uploadedImg.width)
ctx.save();
ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = "#ffffff"; ctx.fillStyle = "#ffffff";
ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.fillRect(0, 0, canvas.width, canvas.height);
...@@ -267,7 +265,7 @@ var drawImage = function () { ...@@ -267,7 +265,7 @@ var drawImage = function () {
ctx.translate(imgInfo.x, imgInfo.y); ctx.translate(imgInfo.x, imgInfo.y);
ctx.rotate(Math.PI / 180 * imgInfo.rotation); ctx.rotate(Math.PI / 180 * imgInfo.rotation);
ctx.scale(imgInfo.scale, imgInfo.scale); ctx.scale(imgInfo.scale, imgInfo.scale);
ctx.drawImage(uploadedImg, -uploadedImg.width / 2, -uploadedImg.height / 2); ctx.drawImage(uploadedImg, -uploadedImg.width / 2, -uploadedImg.height / 2, uploadedImg.width * 2, uploadedImg.height * 2);
ctx.restore(); ctx.restore();
} }
var img = loadedImages['/Public/static/image2/cover/3.png']; var img = loadedImages['/Public/static/image2/cover/3.png'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment