Browse Source

ComPDFKit.Demo(win) - 优化内容编辑Path对象多选卡顿问题(待完善)

TangJinZhou 1 tuần trước cách đây
mục cha
commit
8bd221e428
1 tập tin đã thay đổi với 22 bổ sung11 xóa
  1. 22 11
      Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.TextEdit.cs

+ 22 - 11
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.TextEdit.cs

@@ -1720,10 +1720,25 @@ namespace ComPDFKit.Tool
                 //    checkList.AddRange(unCheckList);
                 //}
 
+                //Multiple selection of mouse styles
+                MultiSelectedRect multiSelectedRect = CommonHelper.FindVisualChild<MultiSelectedRect>(PDFViewer.GetViewForTag(MultiSelectedRectViewTag));
+                if (multiSelectedRect != null && multiSelectedRect.selectedRects.Count > 0)
+                {
+                    PointControlType pointMultiControlType = multiSelectedRect.GetHitControlIndex(point);
+                    if (pointMultiControlType != PointControlType.None)
+                    {
+                        cursor = GetCursors(pointMultiControlType, true);
+                        return cursor;
+                    }
+                }
+
                 foreach (SelectedRect rect in hitTestRects)
                 {
-                    PointControlType pointControlType = rect.GetHitControlIndex(point, false);
-                    MultiSelectedRect multiSelectedRect = CommonHelper.FindVisualChild<MultiSelectedRect>(PDFViewer.GetViewForTag(MultiSelectedRectViewTag));
+                    if (multiSelectedRect != null && multiSelectedRect.selectedRects.Contains(rect))
+                    {
+                        continue;
+                    }
+
                     if (GetIsCropMode())
                     {
                         PointControlType pointCropControlType = rect.GetHitCropControlIndex(point, false);
@@ -1735,13 +1750,7 @@ namespace ComPDFKit.Tool
                     }
                     else
                     {
-                        //Multiple selection of mouse styles
-                        if (multiSelectedRect != null && multiSelectedRect.Children.Count > 0)
-                        {
-                            PointControlType pointMultiControlType = multiSelectedRect.GetHitControlIndex(Mouse.GetPosition(this));
-                            cursor = GetCursors(pointMultiControlType, true);
-                        }
-
+                        PointControlType pointControlType = rect.GetHitControlIndex(point, false);
                         if (pointControlType != PointControlType.None)
                         {
                             EditAreaObject editAreaObject = GetEditAreaObjectForRect(rect);
@@ -2321,7 +2330,7 @@ namespace ComPDFKit.Tool
         {
             if (rectFrameSelect.Width == 0 || rectFrameSelect.Height == 0 || PDFViewer.CurrentRenderFrame == null)
                 return;
- 
+
             RenderFrame currentRenderFrame = PDFViewer.CurrentRenderFrame;
             BaseLayer customizeLayer = PDFViewer.GetViewForTag(textEditTag);
             customizeLayer.Children.Clear();
@@ -2440,7 +2449,9 @@ namespace ComPDFKit.Tool
                 }
             }
 
-            PDFViewer.UpdateRenderFrame();
+            //PDFViewer.UpdateRenderFrame();
+            SetEditTextRect(PDFViewer.CurrentRenderFrame);
+            ReDrawSelectedMultiRect();
         }
 
         #endregion