Browse Source

Merge branch 'feature/multilingual' into preparing

liutian 1 month ago
parent
commit
e8510d03e5

+ 4 - 0
packages/core/src/index.js

@@ -3082,6 +3082,10 @@ class ComPDFKitViewer {
       await this.updateTextPtr();
     }
 
+    if (oldMode !== 'editor' && this.toolMode === 'editor') {
+      this.contentEditManager && this.contentEditManager.getSelectedEditBox() && this.contentEditManager.setSelectedEditBox(null)
+    }
+
     if (oldMode === 'separation' && this.toolMode !== 'separation') {
       this.colorList.length = 0
       annotationStore.ignoreColors.length = 0

+ 9 - 1
packages/core/src/markup/markup_annotation.js

@@ -136,7 +136,15 @@ class MakupAnnotation extends BaseAnnotation {
 
   getActualRect (s) {
     const annotation = this.annotation
-    const { left: x1, top: y1, right: x2, bottom: y2 } = annotation.rect
+    let { left: x1, top: y1, right: x2, bottom: y2 } = annotation.rect
+    x1 = Math.min(x1, x2)
+    x1 = Math.max(x1, 0)
+    y1 = Math.min(y1, y2)
+    y1 = Math.max(y1, 0)
+    x2 = Math.max(x1, x2)
+    x2 = Math.min(x2, this.layer.viewport.rawDims.pageWidth)
+    y2 = Math.max(y1, y2)
+    y2 = Math.min(y2, this.layer.viewport.rawDims.pageHeight)
 
     const start = getActualPoint(
       {

+ 1 - 1
packages/core/src/worker/compdfkit_worker.js

@@ -4029,7 +4029,7 @@ function setFreeText(data) {
   const color = convertColorToCppFormat(rawColor)
 
   Module._SetAnnotContent(annotPtr, contents)
-  Module._SetAnnotFontDa(annotPtr, fontName, fontSize, color.R / 255, color.G / 255, color.B / 255)
+  Module._SetAnnotFontDa(annotPtr, fontName, fontSize, color.R, color.G, color.B)
   Module._SetTextAlignment(annotPtr, textAlignmentInt)
   Module._SetFreeTextType(annotPtr, 0)
   Module._SetAnnotBorderWidth(annotPtr, 0)

+ 4 - 4
packages/webview/locales/ja.json

@@ -162,11 +162,11 @@
   },
 
   "rightPanel": {
-    "general": "一般的な",
+    "general": "一般",
     "name": "名前",
     "formField": "フォームフィールド",
     "visible": "見える",
-    "hidden": "隠れた",
+    "hidden": "隠",
     "properties": "プロパティ",
     "requried": "必須",
     "differentNameError": "別の名前を選択してください",
@@ -492,8 +492,8 @@
     "decryption": "復号化",
 
     "redaction": "墨消し",
-    "fillBlack": "黒塗りつぶす",
-    "fillWhite": "白塗りつぶす",
+    "fillBlack": "黒塗りつぶす",
+    "fillWhite": "白塗りつぶす",
     "caution": "注意",
     "enterTip": "編集されたコンテンツはこのドキュメントから永久に削除されます。アクションを確認してください。",
     "understand": "理解して始める",