浏览代码

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

liyuxuan 5 月之前
父节点
当前提交
ecbcaf641b
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.TextEdit.cs

+ 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);