Commit 69cac9a9 by doszhang

dos

parent fae76279
...@@ -65,7 +65,6 @@ preloadimages(preloadImageList, function () { ...@@ -65,7 +65,6 @@ preloadimages(preloadImageList, function () {
let canvasinfo = initCanvas('.black', 'uploadCanvas', 257, 257); let canvasinfo = initCanvas('.black', 'uploadCanvas', 257, 257);
uploadCanvas = canvasinfo[0]; uploadCanvas = canvasinfo[0];
uploadCtx = canvasinfo[1]; uploadCtx = canvasinfo[1];
console.log(blackUrl)
}, function (progress) {}); }, function (progress) {});
$(document).ready(function () { $(document).ready(function () {
...@@ -92,7 +91,9 @@ $(document).ready(function () { ...@@ -92,7 +91,9 @@ $(document).ready(function () {
}, imgInfo); }, imgInfo);
return false; return false;
}); });
$('.btn-retry').on('click', () => {
$('input[name=btn-upload]').click()
})
}); });
function bindMc(mc, ctx, myCanvas, img, imgInfo) { function bindMc(mc, ctx, myCanvas, img, imgInfo) {
...@@ -214,13 +215,11 @@ function drawImage(ctx, myCanvas, img, imgInfo) { ...@@ -214,13 +215,11 @@ function drawImage(ctx, myCanvas, img, imgInfo) {
} }
function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) { function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) {
console.log(1);
if (useRem) { if (useRem) {
canvasWidth = pxToRem(canvasWidth); canvasWidth = pxToRem(canvasWidth);
canvasHeight = pxToRem(canvasHeight); canvasHeight = pxToRem(canvasHeight);
} }
black = loadedImages[blackUrl]; black = loadedImages[blackUrl];
console.log(black)
$(target).append($('<canvas id="' + id + '" width="' + canvasWidth + '" height="' + canvasHeight + '"></canvas>')); $(target).append($('<canvas id="' + id + '" width="' + canvasWidth + '" height="' + canvasHeight + '"></canvas>'));
canvas = $('#' + id)[0]; canvas = $('#' + id)[0];
ctx = canvas.getContext("2d"); ctx = canvas.getContext("2d");
......
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