|
@@ -208,7 +208,7 @@ Page({
|
|
|
simulationFont = wx.getStorageSync('simulationFont' + i);
|
|
|
dataPositionObj = util.changeCup(i.toString()).dataPositionObj;
|
|
|
const ctx = wx.createCanvasContext('comb-font'+i);
|
|
|
- ctx.textBaseline = 'top';
|
|
|
+ // ctx.textBaseline = 'top';
|
|
|
ctx.setFontSize(fontTouch.fontSize);
|
|
|
ctx.setFillStyle(fontTouch.isColor);
|
|
|
const metrics = ctx.measureText(fontTouch.fontContent)
|
|
@@ -216,7 +216,7 @@ Page({
|
|
|
let movey = fontTouch.y + simulationFont.height / 2;
|
|
|
ctx.translate(movex, movey);
|
|
|
ctx.rotate(fontTouch.angle * Math.PI / 180);
|
|
|
- ctx.fillText(fontTouch.fontContent, -metrics.width / 2, -simulationFont.height / 2);
|
|
|
+ ctx.fillText(fontTouch.fontContent, -metrics.width / 2, -simulationFont.height / 2 + simulationFont.height / 5 * 4);
|
|
|
|
|
|
console.log(metrics,"文本的宽度")
|
|
|
ctx.draw(false,function () {
|