Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textalign center 设置 无效 #71

Open
webyzf0109 opened this issue Mar 27, 2019 · 1 comment
Open

textalign center 设置 无效 #71

webyzf0109 opened this issue Mar 27, 2019 · 1 comment

Comments

@webyzf0109
Copy link

No description provided.

@SJAY-CN
Copy link

SJAY-CN commented Apr 19, 2019

定义 type = text 的 width 宽度,如

textAlign: 'center',
top: 124,
left: 75,
bolder: true,
breakWord:true,
MaxLineNumber: 1,
width: 220

在 canvasdrawer.sj 约200行,加一个判断

if (textAlign === 'center') { let leftM = width / 2 + left; this.ctx.fillText(fillText, leftM, fillTop) } else { this.ctx.fillText(fillText, left, fillTop) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants