Selaa lähdekoodia

fix: 二轮测试修复(p7)

wzl 1 vuosi sitten
vanhempi
commit
b583f8e306

+ 1 - 1
packages/core/src/editor/add_text.js

@@ -111,7 +111,7 @@ export default class AddText {
         left: newStart.x,
         top: newStart.y,
         right: newEnd.x,
-        bottom: newEnd.y
+        bottom: newStart.y + 16
       }
 
       const data = {

+ 12 - 18
packages/core/src/editor/text_editor.js

@@ -735,7 +735,7 @@ export class TextEditor {
       this.selectedCharRange = { start, end }
 
       this.cursor.style.display = 'none'
-      this.updateSelectedRect()
+      this.updateSelectedRect(true)
     }
 
     this.mouseMoved = true
@@ -1187,18 +1187,17 @@ export class TextEditor {
   }
 
   // 更新选中文本的矩形框信息
-  async updateSelectedRect () {
+  async updateSelectedRect (isMoving) {
     if (!this.selectedCharRange) return
     const { start, end } = this.selectedCharRange
     const selectedRectList = await this.getCharsRect(start, end)
     if (!selectedRectList?.length) return
   
-    const { left: rectLeft, top: rectTop } = this.rect
-  
     const lastSelectedRect = this.selectedRects?.[this.selectedRects.length - 1]
   
     // check if the last selected rectangle is the same as the new one
     if (
+      isMoving &&
       lastSelectedRect?.left === selectedRectList[0].left &&
       lastSelectedRect?.top === selectedRectList[0].top &&
       lastSelectedRect?.width === selectedRectList[0].width &&
@@ -1341,7 +1340,6 @@ export class TextEditor {
           await this.setCharsFontStyle('SetCharsFontBold')
         } else if (fontStyle === 2) {
           await this.setCharsFontStyle('SetCharsFontItalic')
-          action = 'SetCharsFontItalic'
         } else if (fontStyle === 3) {
           await this.setCharsFontStyle('SetCharsFontBold')
           await this.setCharsFontStyle('SetCharsFontItalic')
@@ -1363,6 +1361,13 @@ export class TextEditor {
       end: this.selectedCharRange.end,
     })
     this.selectedCharRange = { start, end }
+
+    if (this.activeCharPlace.CharIndex === start.CharIndex) {
+      this.activeCharPlace = start
+    } else {
+      this.activeCharPlace = end
+    }
+    
     this.updateSelectedRect()
   }
 
@@ -1456,19 +1461,8 @@ export class TextEditor {
     )
     this.cursor = cursor
     this.textContainer.append(this.cursor)
-    
-    const cursorLine = createSvg(
-      'line',
-      {
-        x1: 0,
-        x2: 0,
-        y1: 0,
-        y2: 20,
-        stroke: 'currentcolor'
-      },
-    )
-    this.cursorLine = cursorLine
-    this.cursor.append(cursorLine)
+
+    this.updateCursorLine()
 
     this.textarea.focus()
     this.textarea.addEventListener('blur', this.onBlur)

+ 4 - 0
packages/webview/src/components/DocumentContainer/DocumentContainer.vue

@@ -653,6 +653,10 @@ onMounted(async () => {
   }
 }
 
+.document-container.pdfPresentationMode .contentContainer {
+  display: none !important;
+}
+
 @keyframes caretanimation {
   0% {
     color: #000;

+ 6 - 3
packages/webview/src/components/EditTextPanel/EditTextPanel.vue

@@ -425,9 +425,12 @@
           display: none;
         }
       }
-    }
-    .n-base-select-option:active {
-      color: var(--c-text);
+      &:active {
+        color: var(--c-text);
+      }
+      &.n-base-select-option--show-checkmark {
+        padding-right: calc(var(--n-option-padding-right) + 10px);
+      }
     }
     .edit-select {
       background: var(--c-right-side-content-fillbox-bg);

+ 4 - 0
packages/webview/src/components/FullScreenButton/FullScreenButton.vue

@@ -14,10 +14,13 @@
   import core from '@/core'
   import { computed } from 'vue'
   import { useViewerStore } from '@/stores/modules/viewer'
+  import { useDocumentStore } from '@/stores/modules/document'
   const { requestFullScreenMode } = core
 
   const { item } = defineProps(['item'])
   const useViewer = useViewerStore()
+  const useDocument = useDocumentStore()
+
   const isActive = computed(() => {
     return useViewer.isElementOpen('leftPanel')
   })
@@ -41,6 +44,7 @@
     if (imgUi) imgUi.remove()
 
     requestFullScreenMode()
+    useDocument.setToolState('')
   }
 </script>
 

+ 3 - 1
packages/webview/src/components/PageNavOverlay/PageNavOverlay.vue

@@ -100,7 +100,7 @@
     justify-content: space-between;
     align-items: center;
     transform: translateX(-50%);
-    width: 100px;
+    min-width: 100px;
     height: 36px;
     padding: 8px;
     background: rgba(0, 0, 0, 0.8);
@@ -109,6 +109,7 @@
     .button {
       color: #FFF;
       padding: 0;
+      margin: 0;
       &:hover, &:active {
         background-color: transparent;
       }
@@ -117,6 +118,7 @@
   .form-container {
     display: flex;
     align-items: center;
+    margin: 0 10px;
     input {
       min-width: 8px;
       line-height: 16px;