|
@@ -36,6 +36,7 @@ using PDF_Master.Views.BOTA;
|
|
|
using ImTools;
|
|
|
using PDF_Master.ViewModels.Tools.AnnotManager;
|
|
|
using PDF_Master.EventAggregators;
|
|
|
+using DryIoc;
|
|
|
|
|
|
namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
@@ -609,7 +610,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
if (CheckPageNumVaild(out int pageNum, PageNumTextContent))
|
|
|
{
|
|
|
//isSelected = true;
|
|
|
-
|
|
|
+ historyPageIndex = LinkAnnotArgs.PageIndex;
|
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageNum - 1);
|
|
|
AnnotAttribEvent?.UpdateAnnot();
|
|
@@ -940,14 +941,17 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
int pageIndex = Convert.ToInt32(PageNumTextContent) - 1;
|
|
|
|
|
|
+ Rect rect = LinkAnnotArgs.GetLinkCreateArea();
|
|
|
+
|
|
|
if (btnGOorBack.Tag.ToString() == "GO")
|
|
|
{
|
|
|
+ pdfViewer.GoToPage(pageIndex);
|
|
|
+
|
|
|
//AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkType, LINK_TYPE.GOTO);
|
|
|
//AnnotAttribEvent?.UpdateAttrib(AnnotAttrib.LinkDestIndx, pageIndex);
|
|
|
//AnnotAttribEvent?.UpdateAnnot();
|
|
|
|
|
|
historyPageIndex = LinkAnnotArgs != null ? LinkAnnotArgs.PageIndex : backPageIndex;
|
|
|
- pdfViewer.GoToPage(pageIndex);
|
|
|
|
|
|
ChangeBtnGOorBack("BACK", btnGOorBack);
|
|
|
}
|
|
@@ -957,6 +961,33 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
SelectAnnotation();
|
|
|
pdfViewer.GoToPage(historyPageIndex);
|
|
|
+
|
|
|
+ double vertical = pdfViewer.GetVerticalOffset();
|
|
|
+ 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;
|
|
|
+ pdfViewer.ScrollToVerticalOffset(height);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (docPage.PageSize.Height / 2 < rect.Top)
|
|
|
+ {
|
|
|
+ height = vertical + y1 - y * zoom;
|
|
|
+ pdfViewer.ScrollToVerticalOffset(height);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //pdfViewer.SelectAnnotation(historyPageIndex, LinkAnnotArgs.AnnotIndex);
|
|
|
ChangeBtnGOorBack("GO", btnGOorBack);
|
|
|
}
|
|
|
}
|