Commit 5c0bdd17 by doszhang

dos

parent 5c0608e8
...@@ -77,7 +77,7 @@ preloadimages(preloadImageList, function () { ...@@ -77,7 +77,7 @@ preloadimages(preloadImageList, function () {
$('input[name=job-number]').attr('placeholder', '请输入工号').attr('type', 'tel'); $('input[name=job-number]').attr('placeholder', '请输入工号').attr('type', 'tel');
// blackUrl = $('.black').css('background-image').replace(/^url\((['"]?)(.*)\1\)$/, '$2'); // blackUrl = $('.black').css('background-image').replace(/^url\((['"]?)(.*)\1\)$/, '$2');
// $('.black').css('background-image', 'none'); // $('.black').css('background-image', 'none');
let canvasinfo = initCanvas('.upload-canvas-block', 'uploadCanvas', 640 * 4, canvasHeight * 4); let canvasinfo = initCanvas('.upload-canvas-block', 'uploadCanvas', 640 * 2, canvasHeight * 2);
uploadCanvas = canvasinfo[0]; uploadCanvas = canvasinfo[0];
uploadCtx = canvasinfo[1]; uploadCtx = canvasinfo[1];
...@@ -395,8 +395,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) { ...@@ -395,8 +395,8 @@ function bindMc(mc, ctx, myCanvas, img, imgInfo) {
oldpoz.x = event.deltaX; oldpoz.x = event.deltaX;
oldpoz.y = event.deltaY; oldpoz.y = event.deltaY;
//console.log("movedX:" + movedX + ' movedY:' + movedY + 'event.deltaX:' + event.deltaX + ' event.deltaY:' + event.deltaY + "\r\n"); //console.log("movedX:" + movedX + ' movedY:' + movedY + 'event.deltaX:' + event.deltaX + ' event.deltaY:' + event.deltaY + "\r\n");
imgInfo.x += movedX * 4; imgInfo.x += movedX * 2;
imgInfo.y += movedY * 4; imgInfo.y += movedY * 2;
drawImage(ctx, myCanvas, img, imgInfo); drawImage(ctx, myCanvas, img, imgInfo);
} }
}); });
...@@ -477,11 +477,11 @@ function drawImage(ctx, myCanvas, img, imgInfo) { ...@@ -477,11 +477,11 @@ function drawImage(ctx, myCanvas, img, imgInfo) {
ctx.save(); ctx.save();
ctx.clearRect(0, 0, myCanvas.width, myCanvas.height); ctx.clearRect(0, 0, myCanvas.width, myCanvas.height);
ctx.translate(myCanvas.width / 4, myCanvas.height / 4); ctx.translate(myCanvas.width / 2, myCanvas.height / 2);
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(img, -img.width, -img.height, img.width * 4, img.height * 4); ctx.drawImage(img, -img.width, -img.height, img.width * 2, img.height * 2);
ctx.restore(); ctx.restore();
} }
......
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