Commit e6f8aff0 by doszhang

dos

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