|
@@ -303,7 +303,7 @@ namespace ComPDFKit.Tool.DrawTool
|
|
|
(DPIRect.Left - pageBound.X + (cropPoint.X * zoomFactor)) / zoomFactor, (DPIRect.Top - pageBound.Y + (cropPoint.Y * zoomFactor)) / zoomFactor,
|
|
|
DPIRect.Width / zoomFactor, DPIRect.Height / zoomFactor);
|
|
|
isDrawAnnot = false;
|
|
|
- freeTextPoint = new Point((mouseStartPoint.X - pageBound.X) / zoomFactor, (mouseStartPoint.Y - pageBound.Y) / zoomFactor);
|
|
|
+ freeTextPoint = new Point((mouseStartPoint.X - pageBound.X ) / zoomFactor, (mouseStartPoint.Y - pageBound.Y) / zoomFactor);
|
|
|
mouseStartPoint = new Point();
|
|
|
mouseEndPoint = new Point();
|
|
|
moveOffset = new Point();
|
|
@@ -1481,8 +1481,25 @@ namespace ComPDFKit.Tool.DrawTool
|
|
|
textui.Foreground = new SolidColorBrush(textColor);
|
|
|
textui.Background = new SolidColorBrush(backgroundColor);
|
|
|
|
|
|
- textBorder.MaxWidth =(pageBound.Width - MousePoint.X - cropPoint.X);
|
|
|
- textBorder.MaxHeight =(pageBound.Height - MousePoint.Y - cropPoint.Y);
|
|
|
+ double maxWidth = (pageBound.Left+pageBound.Width - MousePoint.X - cropPoint.X * zoomFactor);
|
|
|
+ if (maxWidth > 0)
|
|
|
+ {
|
|
|
+ textBorder.MaxWidth = maxWidth;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ textBorder.MaxWidth = pageBound.Left + pageBound.Width - MousePoint.X;
|
|
|
+ }
|
|
|
+ double maxHeight = (pageBound.Top+pageBound.Height - MousePoint.Y - cropPoint.Y * zoomFactor);
|
|
|
+ if (maxHeight > 0)
|
|
|
+ {
|
|
|
+ textBorder.MaxHeight = maxHeight;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ textBorder.MaxHeight = pageBound.Top + pageBound.Height - MousePoint.Y;
|
|
|
+ }
|
|
|
+
|
|
|
textui.MinHeight = 40;
|
|
|
textui.MinWidth = 200;
|
|
|
|
|
@@ -1551,8 +1568,8 @@ namespace ComPDFKit.Tool.DrawTool
|
|
|
{
|
|
|
updateFreeText.SetContent(textui.Text);
|
|
|
Rect changeRect = new Rect(
|
|
|
- DpiHelper.StandardNumToPDFNum(freeTextPoint.X),
|
|
|
- DpiHelper.StandardNumToPDFNum(freeTextPoint.Y),
|
|
|
+ DpiHelper.StandardNumToPDFNum(freeTextPoint.X + cropPoint.X),
|
|
|
+ DpiHelper.StandardNumToPDFNum(freeTextPoint.Y + cropPoint.Y),
|
|
|
DpiHelper.StandardNumToPDFNum(textBorder.ActualWidth / zoomFactor),
|
|
|
DpiHelper.StandardNumToPDFNum(textBorder.ActualHeight / zoomFactor));
|
|
|
|