diff --git a/lib/pen.js b/lib/pen.js index 4bfed02..47f8c1f 100644 --- a/lib/pen.js +++ b/lib/pen.js @@ -547,7 +547,7 @@ export default class Painter { } let lineIndex = 0; for (let j = 0; j < textArray.length; ++j) { - const preLineLength = Math.floor(textArray[j].length / linesArray[j]); + const preLineLength = Math.ceil(textArray[j].length / linesArray[j]); let start = 0; let alreadyCount = 0; for (let i = 0; i < linesArray[j]; ++i) { diff --git a/painter.js b/painter.js index e24902c..3a73580 100644 --- a/painter.js +++ b/painter.js @@ -630,7 +630,9 @@ Component({ this.bottomContext || (this.bottomContext = wx.createCanvasContext('bottom', this)); this.topContext || (this.topContext = wx.createCanvasContext('top', this)); this.globalContext || (this.globalContext = wx.createCanvasContext('k-canvas', this)); - new Pen(this.bottomContext, palette).paint(); + new Pen(this.bottomContext, palette).paint(() => { + this.triggerEvent('didShow'); + }); new Pen(this.globalContext, { width, height,