Commit acf24efa by doszhang

dos

parent dd5a2184
...@@ -222,15 +222,15 @@ $(document).ready(function () { ...@@ -222,15 +222,15 @@ $(document).ready(function () {
var uploadctx = uploadedImg.getContext('2d'); var uploadctx = uploadedImg.getContext('2d');
var scale = 1; var scale = 1;
if (width < height) { if (width < height) {
scale = 1000 / width; scale = 500 / width;
} else { } else {
scale = 1000 / height; scale = 500 / height;
} }
// uploadctx.scale(scale, scale); // uploadctx.scale(scale, scale);
uploadedImg.width = width; uploadedImg.width = width;
uploadedImg.height = height; uploadedImg.height = height;
uploadctx.translate(uploadedImg.width / 2, uploadedImg.height / 2); uploadctx.translate(uploadedImg.width / 2, uploadedImg.height / 2);
// uploadctx.scale(scale, scale); uploadctx.scale(scale, scale);
uploadctx.rotate(Math.PI / 180 * rotation); uploadctx.rotate(Math.PI / 180 * rotation);
uploadctx.drawImage(objectImg, -objectImg.width / 2, -objectImg.height / 2); uploadctx.drawImage(objectImg, -objectImg.width / 2, -objectImg.height / 2);
// $('.canvas').html( '<img src="'+base64Img+'">'); // $('.canvas').html( '<img src="'+base64Img+'">');
......
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