|
@@ -73,9 +73,10 @@ export default {
|
|
|
drawText (ctx, txt, i) {
|
|
|
ctx.fillStyle = this.randomColor(50, 160) // 随机生成字体颜色
|
|
|
ctx.font = this.randomNum(this.fontSizeMin, this.fontSizeMax) + 'px SimHei' // 随机生成字体大小
|
|
|
- let x = (i + 1) * (this.contentWidth / (this.identifyCode.length + 1))
|
|
|
+ let x = (i + 1) * (this.contentWidth / (this.identifyCode.length + 1) - 2)
|
|
|
let y = this.randomNum(this.fontSizeMax, this.contentHeight - 5)
|
|
|
- var deg = this.randomNum(-30, 30)
|
|
|
+ // var deg = this.randomNum(-30, 30)
|
|
|
+ var deg = this.randomNum(-5, 5)
|
|
|
// 修改坐标原点和旋转角度
|
|
|
ctx.translate(x, y)
|
|
|
ctx.rotate(deg * Math.PI / 180)
|