Browse Source

ComPDFKit.Tool(win)-多选移动逻辑优化

liyijie 7 months ago
parent
commit
51a25f3caf
1 changed files with 21 additions and 11 deletions
  1. 21 11
      Demo/Examples/ComPDFKit.Tool/CPDFToolManager.cs

+ 21 - 11
Demo/Examples/ComPDFKit.Tool/CPDFToolManager.cs

@@ -544,23 +544,33 @@ namespace ComPDFKit.Tool
                         cRect = (cPDFEditAreas[e.MultiObjectIndex[i]] as CPDFEditImageArea).GetClipRect();
                     }
                     Point point = DpiHelper.StandardPointToPDFPoint(e.MoveOffset);
-                    if ((float)point.X == 0)
+                    if (point.X != 0 && point.Y != 0 && e.ZoomX == 1 && e.ZoomY == 1)
                     {
                         cRect.left += (float)point.X;
-                        cRect.right = cRect.left + (cRect.right - cRect.left) * e.ZoomX;
-                    }
-                    else
-                    {
-                        cRect.left += (float)point.X;
-                    }
-                    if ((float)point.Y == 0)
-                    {
+                        cRect.right += (float)point.X;
                         cRect.top += (float)point.Y;
-                        cRect.bottom = cRect.top + (cRect.bottom - cRect.top) * e.ZoomY;
+                        cRect.bottom += (float)point.Y;
                     }
                     else
                     {
-                        cRect.top += (float)point.Y;
+                        if ((float)point.X == 0)
+                        {
+                            cRect.left += (float)point.X;
+                            cRect.right = cRect.left + (cRect.right - cRect.left) * e.ZoomX;
+                        }
+                        else {
+                            
+                            cRect.left += (float)point.X;
+                        }
+                        if ((float)point.Y == 0)
+                        {
+                            cRect.top += (float)point.Y;
+                            cRect.bottom = cRect.top + (cRect.bottom - cRect.top) * e.ZoomY;
+                        }
+                        else {
+                            
+                            cRect.top += (float)point.Y;
+                        }
                     }
                     //Original Logic
                     //cRect.left += (float)point.X;