update readme and example

This commit is contained in:
CPPAlien 2018-07-17 14:08:09 +08:00
parent db221b934d
commit 0bc7aed2c6

View File

@ -207,7 +207,7 @@ export default class Painter {
while (this.ctx.measureText(`${text}...`).width > width) {
text = text.substring(0, text.length - 1);
}
text += "..."
text += '...';
}
const x = -(width / 2);
const y = -(height / 2) + (i === 0 ? view.css.fontSize.toPx() : (view.css.fontSize.toPx() + i * lineHeight));