|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
this._canvas.addEventListener('mousemove', this.handleMouseMove)
|
|
|
this._canvas.addEventListener('mousedown', this.handleMouseDown)
|
|
|
this._canvas.addEventListener('mouseup', this.handleMouseUp)
|
|
|
- this._interval = setInterval(this.shiftPoints, 36)
|
|
|
+ this._interval = setInterval(this.shiftPoints, 40)
|
|
|
},
|
|
|
destroyed () {
|
|
|
clearInterval(this._interval)
|
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
const { x, y } = this.points[this.points.length - 1] ?? { x: 0, y: 0 }
|
|
|
if (this.points.length === 0 || Math.abs(x - e.clientX) > 8 || Math.abs(y - e.clientY) > 8) {
|
|
|
this.points.unshift({ x: e.clientX, y: e.clientY })
|
|
|
- if (this.points.length > 30) {
|
|
|
+ if (this.points.length > 24) {
|
|
|
this.points.pop()
|
|
|
}
|
|
|
}
|
|
|
@@ -113,7 +113,7 @@ export default {
|
|
|
// 框选
|
|
|
this._ctx.lineWidth = 4
|
|
|
this._ctx.lineJoin = 'round'
|
|
|
- this._ctx.strokeStyle = `rgba(211, 47, 47, 1)`
|
|
|
+ this._ctx.strokeStyle = `rgba(211, 47, 47, .04)`
|
|
|
this._ctx.fillStyle = `rgba(211, 47, 47, .1)`
|
|
|
this.rects.forEach(rect => {
|
|
|
if (rect) {
|