|
@@ -731,14 +731,14 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
//没有选择注释工具、也不是右键添加注释
|
|
|
//在阅读页,选择注释后,点击按钮
|
|
|
//需要设置相关参数
|
|
|
- if (AnnotAttribEvent.IsAnnotCreateReset == false && propertyPanel.IsAddLink == false)
|
|
|
- {
|
|
|
- propertyPanel.IsLocationLink = true;
|
|
|
+ //if (AnnotAttribEvent.IsAnnotCreateReset == false && propertyPanel.IsAddLink == false)
|
|
|
+ //{
|
|
|
+ // propertyPanel.IsLocationLink = true;
|
|
|
|
|
|
- pdfViewer.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
+ // pdfViewer.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
|
|
|
- pdfViewer.SetToolParam(LinkAnnotArgs);
|
|
|
- }
|
|
|
+ // pdfViewer.SetToolParam(LinkAnnotArgs);
|
|
|
+ //}
|
|
|
|
|
|
historyPageIndex = pdfViewer.CurrentIndex;
|
|
|
|
|
@@ -779,6 +779,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
//AnnotAttribEvent.IsAnnotCreateReset = true;
|
|
|
}
|
|
|
|
|
|
+ private Rect paintrect;
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 定位目标范围完成时,触发
|
|
|
/// </summary>
|
|
@@ -808,6 +810,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
LinkAnnotArgs.IsPositionSet = true;
|
|
|
LinkAnnotArgs.DestIndex = areaInfo.PageIndex;
|
|
|
LinkAnnotArgs.DestinationPos = new System.Windows.Point(areaInfo.Area.X, pageSize.Height - areaInfo.Area.Y);
|
|
|
+ paintrect = LinkAnnotArgs.GetLinkCreateArea();
|
|
|
|
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, areaInfo.PageIndex);
|
|
@@ -820,6 +823,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
}
|
|
|
+ Rect rect = LinkAnnotArgs.GetLinkPaintArea();
|
|
|
|
|
|
BtnLocationIsChecked = false;
|
|
|
|
|
@@ -831,12 +835,12 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
//没有选择注释工具、也不是右键添加注释
|
|
|
//在阅读页,选择注释后,点击按钮
|
|
|
//需要设置相关参数
|
|
|
- if (propertyPanel.IsLocationLink)
|
|
|
- {
|
|
|
- pdfViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
- propertyPanel.IsLocationLink = false;
|
|
|
- pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
- }
|
|
|
+ //if (propertyPanel.IsLocationLink)
|
|
|
+ //{
|
|
|
+ // pdfViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
+ // propertyPanel.IsLocationLink = false;
|
|
|
+ // pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -941,7 +945,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
int pageIndex = Convert.ToInt32(PageNumTextContent) - 1;
|
|
|
|
|
|
- Rect rect = LinkAnnotArgs.GetLinkCreateArea();
|
|
|
+ //目前只适用于 非定位的链接
|
|
|
+
|
|
|
+ //注释位置
|
|
|
+ Rect rect = LinkAnnotArgs.GetLinkPaintArea();
|
|
|
|
|
|
if (btnGOorBack.Tag.ToString() == "GO")
|
|
|
{
|
|
@@ -966,29 +973,47 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
double height = 0;
|
|
|
CPDFDocument doc = pdfViewer.Document;
|
|
|
CPDFPage docPage = doc.PageAtIndex(historyPageIndex, false);
|
|
|
- double y = docPage.PageSize.Height - rect.Top;
|
|
|
- double zoom = pdfViewer.ZoomFactor;
|
|
|
- double y1 = (rect.Y / 2) * zoom;
|
|
|
- if (historyPageIndex < pageIndex)
|
|
|
- {
|
|
|
- if (docPage.PageSize.Height / 2 < rect.Top)
|
|
|
- {
|
|
|
- //double y1 = (rect.Y / 2) * zoom;
|
|
|
- height = vertical + y1 + y * zoom;
|
|
|
- height = vertical + (rect.Bottom * zoom);
|
|
|
- pdfViewer.ScrollToVerticalOffset(height);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
+
|
|
|
+ if (!rect.IsEmpty)
|
|
|
{
|
|
|
+ //double y = docPage.PageSize.Height - rect.Top;
|
|
|
+ double zoom = pdfViewer.ZoomFactor;
|
|
|
+ //double y1 = (rect.Y / 2) * zoom;
|
|
|
if (docPage.PageSize.Height / 2 < rect.Top)
|
|
|
{
|
|
|
- height = vertical + (rect.Y / 2) - y * zoom;
|
|
|
- height = vertical + (rect.Top * zoom);
|
|
|
- pdfViewer.ScrollToVerticalOffset(height);
|
|
|
+ if (historyPageIndex < pageIndex)
|
|
|
+ {
|
|
|
+ height = vertical + (rect.Bottom * zoom);
|
|
|
+ pdfViewer.ScrollToVerticalOffset(height);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ height = vertical + (rect.Top * zoom);
|
|
|
+ pdfViewer.ScrollToVerticalOffset(height);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //if (historyPageIndex < pageIndex)
|
|
|
+ //{
|
|
|
+ // if (docPage.PageSize.Height / 2 < rect.Top)
|
|
|
+ // {
|
|
|
+ // //double y1 = (rect.Y / 2) * zoom;
|
|
|
+ // //height = vertical + y1 + y * zoom;
|
|
|
+ // height = vertical + (rect.Bottom * zoom);
|
|
|
+ // pdfViewer.ScrollToVerticalOffset(height);
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // if (docPage.PageSize.Height / 2 < rect.Top)
|
|
|
+ // {
|
|
|
+ // //height = vertical + (rect.Y / 2) - y * zoom;
|
|
|
+ // height = vertical + (rect.Top * zoom);
|
|
|
+ // pdfViewer.ScrollToVerticalOffset(height);
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
//pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
ChangeBtnGOorBack("GO", btnGOorBack);
|
|
|
}
|