Browse Source

Merge branch 'compdfkit_demo_win_dev' of http://git.kdan.cc:8865/Others/kmpdfkit_demo into compdfkit_demo_win_dev

liyijie 2 months ago
parent
commit
8525049312

+ 4 - 2
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.Annot.cs

@@ -872,8 +872,10 @@ namespace ComPDFKit.Tool
                     textBorder.BorderBrush = new SolidColorBrush(borderColor);
                     textBorder.BorderThickness = new Thickness(DpiHelper.PDFNumToStandardNum(textWidget.GetBorderWidth() * annotData.CurrentZoom));
                     textui.BorderThickness = new Thickness(0);
-                    textui.Text = textWidget.Content;
-
+                    if (string.IsNullOrEmpty(textui.Text) == false)
+                    {
+                        textui.CaretIndex = textui.Text.Length;
+                    }
                     textui.FontFamily = new FontFamily(GetFontName(textAttribute.FontName));
                     textui.FontWeight = IsBold(textAttribute.FontName) ? FontWeights.Bold : FontWeights.Normal;
                     textui.FontStyle = IsItalic(textAttribute.FontName) ? FontStyles.Italic : FontStyles.Normal;

+ 0 - 1
Demo/Examples/ComPDFKit.Tool/DrawTool/CreateAnnotTool.cs

@@ -1469,7 +1469,6 @@ namespace ComPDFKit.Tool.DrawTool
                     CPDFFreeTextAnnotation annotFreeText = (cPDFAnnotation as CPDFFreeTextAnnotation);
 
                     TextBox textui = new TextBox();
-                    textui.Name = "PdfViewerTextBox";
                     DashedBorder textBorder = new DashedBorder();
                     textBorder.Child = textui;
                     textui.Width = 200;