|
@@ -82,7 +82,7 @@ Page({
|
|
*/
|
|
*/
|
|
onShow: function () {
|
|
onShow: function () {
|
|
this.getCombImg(this);
|
|
this.getCombImg(this);
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
@@ -169,19 +169,21 @@ Page({
|
|
},
|
|
},
|
|
getCombFont(that) {
|
|
getCombFont(that) {
|
|
let fontTouch = that.data.fontTouch;
|
|
let fontTouch = that.data.fontTouch;
|
|
|
|
+ // fontTouch.width = 123;
|
|
|
|
+ // fontTouch.height=132;
|
|
let dataPositionObj = that.data.dataPositionObj;
|
|
let dataPositionObj = that.data.dataPositionObj;
|
|
const ctx = wx.createCanvasContext('comb-font');
|
|
const ctx = wx.createCanvasContext('comb-font');
|
|
ctx.setFontSize(fontTouch.fontSize);
|
|
ctx.setFontSize(fontTouch.fontSize);
|
|
ctx.setFillStyle(fontTouch.isColor);
|
|
ctx.setFillStyle(fontTouch.isColor);
|
|
- // ctx.translate(0, 0);
|
|
|
|
|
|
+ // ctx.translate(0, fontTouch.height / 5 * 4);
|
|
// ctx.save();
|
|
// ctx.save();
|
|
let movex = fontTouch.x + fontTouch.width / 2;
|
|
let movex = fontTouch.x + fontTouch.width / 2;
|
|
- let movey = fontTouch.y + fontTouch.height /10* 3 ;
|
|
|
|
|
|
+ let movey = fontTouch.y + fontTouch.height / 10* 3 ;
|
|
ctx.translate(movex, movey);
|
|
ctx.translate(movex, movey);
|
|
ctx.rotate(fontTouch.angle * Math.PI / 180);
|
|
ctx.rotate(fontTouch.angle * Math.PI / 180);
|
|
// ctx.translate(movex, movey);
|
|
// ctx.translate(movex, movey);
|
|
// ctx.rotate(fontTouch.angle * Math.PI / 180);
|
|
// ctx.rotate(fontTouch.angle * Math.PI / 180);
|
|
- ctx.fillText(fontTouch.fontContent, -fontTouch.width / 2, fontTouch.height / 2 );
|
|
|
|
|
|
+ ctx.fillText(fontTouch.fontContent, -fontTouch.width / 2, fontTouch.height / 2);
|
|
// ctx.fillText(fontTouch.fontContent, fontTouch.x, fontTouch.y + fontTouch.height / 5 * 4);
|
|
// ctx.fillText(fontTouch.fontContent, fontTouch.x, fontTouch.y + fontTouch.height / 5 * 4);
|
|
|
|
|
|
ctx.draw(true, function () {
|
|
ctx.draw(true, function () {
|