Commit aa3504e5 by doszhang

dos

parent 8e09d419
......@@ -100,6 +100,7 @@
window.base_resource_url = '__CDN__';
window.getImageUrl = location.origin + '/Index/getImage';
window.user_header_url = '{:$user_header_url|default:""}';
window.nickname = '{:$username|default:""}';
var link = location.origin;
......
......@@ -172,6 +172,7 @@ function createPoster() {
drawRoundedRect(posterCtx, designPxToRealPx(canvasArr[resultType - 1][5] - 6), designPxToRealPx(canvasArr[resultType - 1][4] - 6), designPxToRealPx(52) * 2, designPxToRealPx(52) * 2, designPxToRealPx(5) * 2,
true);
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] + 168), designPxToRealPx(canvasArr[resultType - 1][4] + 104), designPxToRealPx(20), 'normal', '#0f5188')
}
}
}
......@@ -366,6 +367,16 @@ function RandomNumBoth(Min, Max) {
return num;
}
function txtDraw(ctx, content, x, y, fontsize, fontweight, color) {
x = x * 2;
y = y * 2;
fontsize = fontsize * 2;
ctx.font = fontweight + ' ' + fontsize + 'px arial';
ctx.fillStyle = color;
ctx.fillText(content, x, y);
}
function pxToRem(px) {
return px / 20;
......
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