Explorar el Código

feat: 曲线插帧算法

ChenYangfan hace 6 años
padre
commit
82550927d0
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      src/components/PDF/PointerCanvas.vue

+ 3 - 3
src/components/PDF/PointerCanvas.vue

@@ -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) {