Commit e6f8aff0 by doszhang

dos

parent 602b151d
...@@ -212,8 +212,8 @@ $(document).ready(function () { ...@@ -212,8 +212,8 @@ $(document).ready(function () {
objectImg.setAttribute('crossOrigin', 'anonymous'); objectImg.setAttribute('crossOrigin', 'anonymous');
objectImg.onload = function () { objectImg.onload = function () {
var scale = 1, var scale = 1,
width = objectImg.width, width = objectImg.width * 2,
height = objectImg.height; height = objectImg.height * 2;
if (rotation === 90 || rotation === 270) { if (rotation === 90 || rotation === 270) {
width = objectImg.height; width = objectImg.height;
height = objectImg.width; height = objectImg.width;
...@@ -232,7 +232,7 @@ $(document).ready(function () { ...@@ -232,7 +232,7 @@ $(document).ready(function () {
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+'">');
drawImage(); drawImage();
......
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