Parcourir la source

ComPDFKit.Demo(win) - 修复注释列表只能显示当前页面注释的问题,过滤掉Link注释

TangJinZhou il y a 7 mois
Parent
commit
b481889aa0

+ 15 - 0
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.xaml.cs

@@ -337,6 +337,10 @@ namespace ComPDFKit.Tool
             {
                 return;
             }
+
+            if (PDFViewer.IsRendering)
+                return;
+
             if (!HitTestBorder())
             {
                 RemovePopTextUI();
@@ -578,6 +582,10 @@ namespace ComPDFKit.Tool
             {
                 return;
             }
+
+            if (PDFViewer.IsRendering)
+                return;
+
             MouseEventObject mouseEventObject = new MouseEventObject
             {
                 mouseButtonEventArgs = e,
@@ -585,6 +593,7 @@ namespace ComPDFKit.Tool
                 annotType = C_ANNOTATION_TYPE.C_ANNOTATION_NONE,
                 IsCreate = false
             };
+
             if (isDrawSelectRect || IsDrawEditAnnot)
             {
                 mouseEventObject.hitTestType = MouseHitTestType.SelectRect;
@@ -611,6 +620,9 @@ namespace ComPDFKit.Tool
                 return;
             }
 
+            if (PDFViewer.IsRendering)
+                return;
+
             Cursor oldCursor = this.Cursor;
             Cursor newCursor = this.Cursor;
             MouseEventObject mouseEventObject = new MouseEventObject
@@ -724,6 +736,9 @@ namespace ComPDFKit.Tool
 
         protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
         {
+            if (PDFViewer.IsRendering)
+                return;
+
             MouseEventObject mouseEventObject = new MouseEventObject
             {
                 mouseButtonEventArgs = e,

+ 3 - 6
Demo/Examples/Compdfkit.Controls/Annotation/PDFAnnotationList/PDFAnnotationListControl/CPDFAnnotationListControl.xaml.cs

@@ -6,12 +6,9 @@ using ComPDFKit.Tool.Help;
 using ComPDFKitViewer;
 using ComPDFKitViewer.BaseObject;
 using System.Collections.Generic;
-using System.Linq;
 using System.IO;
 using System.Windows;
-using System.Windows.Annotations;
 using System.Windows.Controls;
-using ComPDFKit.Controls.Helper;
 using static ComPDFKit.Controls.PDFControlUI.CPDFAnnotationListUI;
 using ComPDFKit.Controls.PDFControlUI;
 using System.Windows.Input;
@@ -147,16 +144,16 @@ namespace ComPDFKit.Controls.PDFControl
             pdfViewer.UpdateAnnotFrame();
             for (int i = 0; i < pageCount; i++)
             {
-
                 List<AnnotParam> annotList = GetAnnotCommentList(i, pdfViewer.PDFViewTool.GetCPDFViewer().GetDocument());
+                List<CPDFAnnotation> annotCoreList = pdfViewer?.GetCPDFViewer()?.GetDocument()?.PageAtIndex(i, false)?.GetAnnotations();
                 if (annotList != null && annotList.Count > 0)
                 {
                     Dispatcher.Invoke(() =>
                     {
                         foreach (AnnotParam annot in annotList)
                         {
-                            CPDFAnnotation annotCore = pdfViewer?.GetCPDFViewer()?.GetAnnotForIndex(i, annot.AnnotIndex)?.GetAnnotData()?.Annot;
-                            if (annotCore == null || annotCore.IsReplyAnnot())
+                            CPDFAnnotation annotCore = annotCoreList[annot.AnnotIndex];
+                            if (annotCore == null || annotCore.IsReplyAnnot() || annotCore.Type == C_ANNOTATION_TYPE.C_ANNOTATION_LINK)
                             {
                                 continue;
                             }