Prechádzať zdrojové kódy

ComPDFKit.Tool(win) - 禅道问题修改 (移动编辑框,选中边框不应该超出阅读页得边界)

liyuxuan 5 mesiacov pred
rodič
commit
ecbcaf641b

+ 5 - 4
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.TextEdit.cs

@@ -1446,11 +1446,12 @@ namespace ComPDFKit.Tool
             CRect cRect = editArea.GetFrame();
             Rect rect = DataConversionForWPF.CRectConversionForRect(cRect);
             Rect preRect = rect;
-            rect.X = Math.Min(pdfPage.PageSize.width - rect.Width, rect.X + moveOffset.X);
-            rect.Y = Math.Min(pdfPage.PageSize.height - rect.Height, rect.Y + moveOffset.Y);
+            double boundOffset = 5;
+            rect.X = Math.Min(pdfPage.PageSize.width - rect.Width - boundOffset, rect.X + moveOffset.X);
+            rect.Y = Math.Min(pdfPage.PageSize.height - rect.Height - boundOffset, rect.Y + moveOffset.Y);
 
-            rect.X = Math.Max(rect.X, 0);
-            rect.Y = Math.Max(rect.Y, 0);
+            rect.X = Math.Max(rect.X, boundOffset);
+            rect.Y = Math.Max(rect.Y, boundOffset);
 
             editArea.SetFrame(DataConversionForWPF.RectConversionForCRect(rect));
             UpdateSelectRect(editArea);