Commit e1663110 by xuzhenghua

海报

parent 43d32701
......@@ -48,10 +48,10 @@ class SharePoster extends Component {
let avatarWidth = 50 // imgList[index].poster_width // 头像宽度
let avatarHeight = 50 // imgList[index].poster_height // 头像高度
let avatarPositionX = (imgList[index].header_position_x * $width) // 头像x轴位置
let avatarPositionY = (imgList[index].header_position_y * $height) // 头像Y轴位置
let avatarPositionY = (imgList[index].header_position_y * $height)- 18 // 头像Y轴位置
let qrCodePositionX = imgList[index].qr_code_x * $width // 二维码x轴位置
let qrCodePositionY = imgList[index].qr_code_y * $height // 二维码y轴位置
let qrCodePositionY = imgList[index].qr_code_y * $height + 7 // 二维码y轴位置
let qrCodeWidth = (imgList[index].qr_code_width * $width) // 二维码宽度
let qrCodeHeight = (imgList[index].qr_code_height * $height) - avatarHeight / 2 // 二维码高度
......@@ -82,7 +82,7 @@ class SharePoster extends Component {
bgImage.setAttribute('crossOrigin', 'anonymous');
bgImage.onload = function () {
context.drawImage(bgImage, 0, 0, 450, 800);
context.drawImage(qrCodeImg, 320, 685, 100, 100);
context.drawImage(qrCodeImg, qrCodePositionX, qrCodePositionY, 100, 100);
context.fillStyle = imgList[index].username_color;
context.font = "16px serif";
context.fillText('@' + _this.state.name, (avatarPositionX + avatarWidth) + 20, (avatarPositionY + avatarHeight / 2));
......
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 to comment