Bladeren bron

ComPDFKit.Tool(pdftech) - 文字编辑Undo,Redo后增加EndEdit调用

liyuxuan 4 maanden geleden
bovenliggende
commit
1df0151577

+ 5 - 4
Demo/Examples/ComPDFKit.Tool/DrawTool/CreateAnnotTool.cs

@@ -1720,22 +1720,23 @@ namespace ComPDFKit.Tool.DrawTool
                         parentUI.SetValue(Canvas.TopProperty, drawRect.Top);
 
                         // The width is incorrect
+
                         if (mouseEndPoint.X >= mouseStartPoint.X)
                         {
-                            parentUI.MaxWidth = (pageBound.Right - drawRect.X - cropPoint.X);
+                            parentUI.MaxWidth = (pageBound.Right - drawRect.X);
                         }
                         else
                         {
-                            parentUI.MaxWidth = (drawRect.Right - pageBound.X - cropPoint.X);
+                            parentUI.MaxWidth = (drawRect.Right - pageBound.X);
                         }
 
                         if (mouseEndPoint.Y >= mouseStartPoint.Y)
                         {
-                            parentUI.MaxHeight = (pageBound.Bottom - drawRect.Y - cropPoint.Y);
+                            parentUI.MaxHeight = (pageBound.Bottom - drawRect.Y);
                         }
                         else
                         {
-                            parentUI.MaxHeight = (drawRect.Bottom - pageBound.Y - cropPoint.Y);
+                            parentUI.MaxHeight = (drawRect.Bottom - pageBound.Y);
                         }
 
                     }

+ 11 - 7
Demo/Examples/ComPDFKit.Tool/UndoManger/PDFEditHistory/PDFEditHistory.cs

@@ -9,19 +9,23 @@ namespace ComPDFKit.Tool.UndoManger
 		public int PageIndex {  get; set; }
 		public bool Redo()
 		{
-			if(EditPage!=null && EditPage.IsValid())
-			{
-				return EditPage.Redo();
-			}
-			
-			return false;
+            if (EditPage != null && EditPage.IsValid())
+            {
+                bool result = EditPage.Redo();
+                EditPage.EndEdit();
+                return result;
+            }
+
+            return false;
 		}
 
 		public bool Undo()
 		{
 			if(EditPage!=null && EditPage.IsValid())
 			{
-				return EditPage.Undo();
+				bool result= EditPage.Undo();
+				EditPage.EndEdit();
+				return result;
 			}
 			return false;
 		}