Commit 9b881ea6 by doszhang

dos

parent d7d15eea
......@@ -402,7 +402,7 @@ function createPoster() {
decorate.src = checkedDecorate;
decorate.onload = function () {
posterCtx.drawImage(decorate, pxToRem(170 * 2), pxToRem(305 * 2), pxToRem(300 * 2), pxToRem(150 * 2));
flagTextDraw(posterCtx, signature, pxToRem(40 * 2), '#222222', pxToRem(230 * 2), (bottomHalfTop + pxToRem(103)) * 2);
flagTextDraw(posterCtx, signature, pxToRem(40 * 2), '#222222', pxToRem(230 * 2), (bottomHalfTop + pxToRem(103)) * 2, 'font');
flagTextDraw(posterCtx, getTime(), pxToRem(20 * 2), '#222222', pxToRem(230 * 2), (bottomHalfTop + pxToRem(136)) * 2);
setTimeout(function () {
$('.posterImg').attr('src', getManBase64(posterCanvas)).css('height', pxToRem(posterCanvasHeight));
......@@ -936,11 +936,11 @@ function flagNoDraw(ctx, content, fontsize, color, x, y) {
ctx.fillText(content, cx, y);
}
function flagTextDraw(ctx, content, fontsize, color, x, y) {
function flagTextDraw(ctx, content, fontsize, color, x, y, font = "normal") {
let length = calculateStringLength(content);
let lineTop = 0;
if (length <= 24) {
ctx.font = fontsize + 'px normal';
ctx.font = fontsize + 'px ' + font;
ctx.fillStyle = color;
ctx.fillText(content, x, y);
lineTop = y - 8;
......
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