Commit b0b38ede by doszhang

dos

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