Commit b0b38ede by doszhang

dos

parent e90c68b1
...@@ -63,7 +63,7 @@ let answerArr = []; ...@@ -63,7 +63,7 @@ let answerArr = [];
// 已经进入的题目 // 已经进入的题目
let watchedQuestion = [1]; let watchedQuestion = [1];
//结果 //结果
let resultType = 1; let resultType = 3;
//记录初始状态下fontsize //记录初始状态下fontsize
const fontSize = parseFloat($('html').css('fontSize')); const fontSize = parseFloat($('html').css('fontSize'));
...@@ -72,8 +72,9 @@ const fontSize = parseFloat($('html').css('fontSize')); ...@@ -72,8 +72,9 @@ const fontSize = parseFloat($('html').css('fontSize'));
let canvasArr = [ let canvasArr = [
//left top width height headleft headtop color //left top width height headleft headtop color
[46, 240, 1214, 1814, 36, 42, '#0f5188'], [46, 240, 1214, 1814, 36, 42, '#0f5188'],
// [58, 240, 1164, 1748, 34, 30, '#0f5188'], [58, 240, 1164, 1748, 34, 30, '#0f5188'],
// [58, 240, 1206, 1008, 34, 30, '#ffffff'], [58, 240, 1164, 1748, 34, 30, '#0f5188'],
[58, 240, 1206, 1808, 34, 30, '#ffffff'],
// [58, 240, 1164, 1740, 34, 30, '#ffffff'], // [58, 240, 1164, 1740, 34, 30, '#ffffff'],
// [58, 240, 1164, 1008, 34, 30, '#ffffff'], // [58, 240, 1164, 1008, 34, 30, '#ffffff'],
// [58, 240, 1164, 1008, 34, 30, '#0f5188'], // [58, 240, 1164, 1008, 34, 30, '#0f5188'],
...@@ -171,14 +172,14 @@ function createPoster() { ...@@ -171,14 +172,14 @@ function createPoster() {
headimg.onload = function () { headimg.onload = function () {
// posterCtx.drawImage(headimg, designPxToRealPx(canvasArr[resultType - 1][5]), designPxToRealPx(canvasArr[resultType - 1][4]), designPxToRealPx(52), designPxToRealPx(52)); // posterCtx.drawImage(headimg, designPxToRealPx(canvasArr[resultType - 1][5]), designPxToRealPx(canvasArr[resultType - 1][4]), designPxToRealPx(52), designPxToRealPx(52));
drawRoundedRect(posterCtx, designPxToRealPx(canvasArr[resultType - 1][5] - 6), designPxToRealPx(canvasArr[resultType - 1][4] - 6), designPxToRealPx(52) * 2, designPxToRealPx(52) * 2, designPxToRealPx(5) * 2, drawRoundedRect(posterCtx, designPxToRealPx(canvasArr[resultType - 1][5] - 6), designPxToRealPx(canvasArr[resultType - 1][4] - 6), designPxToRealPx(52) * 2, designPxToRealPx(52) * 2, designPxToRealPx(5) * 2,
true); true, canvasArr[resultType - 1][6]);
drawRoundRectImg(posterCtx, designPxToRealPx(5) * 2, designPxToRealPx(canvasArr[resultType - 1][5]), designPxToRealPx(canvasArr[resultType - 1][4]), designPxToRealPx(46) * 2, designPxToRealPx(46) * 2, headimg); drawRoundRectImg(posterCtx, designPxToRealPx(5) * 2, designPxToRealPx(canvasArr[resultType - 1][5]), designPxToRealPx(canvasArr[resultType - 1][4]), designPxToRealPx(46) * 2, designPxToRealPx(46) * 2, headimg);
txtDraw(posterCtx, '@' + window.nickname, designPxToRealPx(canvasArr[resultType - 1][5] + 128), designPxToRealPx(canvasArr[resultType - 1][4] + 84), designPxToRealPx(20), 'normal', '#0f5188') txtDraw(posterCtx, '@' + window.nickname, designPxToRealPx(canvasArr[resultType - 1][5] + 128), designPxToRealPx(canvasArr[resultType - 1][4] + 84), designPxToRealPx(20), 'normal', canvasArr[resultType - 1][6])
} }
} }
} }
function drawRoundedRect(ctx, x, y, width, height, r, fill, stroke) { function drawRoundedRect(ctx, x, y, width, height, r, fill, color) {
ctx.save(); ctx.save();
ctx.fillStyle = "#0f5188"; ctx.fillStyle = "#0f5188";
ctx.beginPath(); // draw top and top right corner ctx.beginPath(); // draw top and top right corner
...@@ -190,9 +191,6 @@ function drawRoundedRect(ctx, x, y, width, height, r, fill, stroke) { ...@@ -190,9 +191,6 @@ function drawRoundedRect(ctx, x, y, width, height, r, fill, stroke) {
if (fill) { if (fill) {
ctx.fill(); ctx.fill();
} }
if (stroke) {
ctx.stroke();
}
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