Parcourir la source

fix: 修正遮住控制组件的问题

ChenYangfan il y a 6 ans
Parent
commit
9ac707c00c
2 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 1 0
      src/components/PDF/PdfController.vue
  2. 4 3
      src/components/PDF/PointerCanvas.vue

+ 1 - 0
src/components/PDF/PdfController.vue

@@ -85,6 +85,7 @@ export default {
   display: flex;
   align-items: center;
   justify-content: center;
+  z-index: 2;
 
   transition: .2s ease-out;
 }

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

@@ -36,13 +36,14 @@ export default {
       console.log(x, e.clientX)
       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 > 20) {
+        if (this.points.length > 30) {
           this.points.pop()
         }
       }
     },
     shiftPoints () {
-      if (this.points.length > 20) {
+      if (this.points.length > 10) {
+        this.points.pop()
         this.points.pop()
       }
       if (this.points.length > 0) {
@@ -78,6 +79,6 @@ export default {
   right: 0;
   width: 100vw;
   height: 100vh;
-  z-index: 1;
+  z-index: 0;
 }
 </style>