Преглед на файлове

ComPDFKit.Tool(Win) - 修复文字选择时若鼠标拖到页面范围外松开会将前面所有页面文字选中

liyuxuan преди 2 месеца
родител
ревизия
07e039d564
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.SelectText.cs

+ 4 - 1
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.SelectText.cs

@@ -51,7 +51,10 @@ namespace ComPDFKit.Tool
             }
             BaseLayer baseLayer = PDFViewer.GetViewForTag(selectTextTag);
             PDFViewer.GetMousePointToPage(out int pageindex, out Point pagepoint);
-            (baseLayer as SelectText).MoveDraw(new Point(DpiHelper.StandardNumToPDFNum(pagepoint.X / PDFViewer.CurrentRenderFrame.ZoomFactor), DpiHelper.StandardNumToPDFNum(pagepoint.Y / PDFViewer.CurrentRenderFrame.ZoomFactor)), pageindex, PDFViewer, new Point(10, 10), DoubleClick);
+            if(pageindex>=0)
+            {
+                (baseLayer as SelectText).MoveDraw(new Point(DpiHelper.StandardNumToPDFNum(pagepoint.X / PDFViewer.CurrentRenderFrame.ZoomFactor), DpiHelper.StandardNumToPDFNum(pagepoint.Y / PDFViewer.CurrentRenderFrame.ZoomFactor)), pageindex, PDFViewer, new Point(10, 10), DoubleClick);
+            }
         }
 
         public void DrawEndSelectText()