From 31d1827c0a83c387065b14eb851ed3c7e6df5e0f Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Wed, 11 Dec 2024 22:07:07 +0700 Subject: [PATCH] [pdf] Refactor update interface tracks --- pdf/src/annotations/annotTrackHandler.js | 2 +- pdf/src/document.js | 14 ++++++++++---- pdf/src/viewer.js | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pdf/src/annotations/annotTrackHandler.js b/pdf/src/annotations/annotTrackHandler.js index dc662d5ad2..7449d62443 100644 --- a/pdf/src/annotations/annotTrackHandler.js +++ b/pdf/src/annotations/annotTrackHandler.js @@ -51,7 +51,7 @@ CAnnotSelectTrackHandler.prototype.OnChangePosition = function(bCheckMouseUpPos) { let oMouseDownAnnot = this.Document.mouseDownAnnot; - if (!oMouseDownAnnot || false == oMouseDownAnnot.IsTextMarkup()) { + if (!oMouseDownAnnot || false == oMouseDownAnnot.IsTextMarkup() || this.Document.Viewer.file.isSelectionUse()) { this.OnHide(); return; } diff --git a/pdf/src/document.js b/pdf/src/document.js index d1054816a4..4fdc48d757 100644 --- a/pdf/src/document.js +++ b/pdf/src/document.js @@ -2796,6 +2796,10 @@ var CPresentation = CPresentation || function(){}; } } + if (this.Viewer.file.isSelectionUse()) { + return; + } + if (oAnnot) { this.showedCommentId = oAnnot.GetId(); @@ -3536,10 +3540,6 @@ var CPresentation = CPresentation || function(){}; let oTargetTextObject = AscFormat.getTargetTextObject(oController); this.UpdateUndoRedo(); - this.UpdateCommentPos(); - this.UpdateMathTrackPos(); - this.UpdateAnnotTrackPos(); - this.UpdateSelectionTrackPos(); this.UpdateCopyCutState(); this.UpdateParagraphProps(); this.UpdateTextProps(); @@ -3551,6 +3551,12 @@ var CPresentation = CPresentation || function(){}; Asc.editor.CheckChangedDocument(); }; + CPDFDoc.prototype.UpdateInterfaceTracks = function() { + this.UpdateCommentPos(); + this.UpdateMathTrackPos(); + this.UpdateAnnotTrackPos(); + this.UpdateSelectionTrackPos(); + }; //----------------------------------------------------------------------------------- // Функции для работы с гиперссылками diff --git a/pdf/src/viewer.js b/pdf/src/viewer.js index 88cfddf877..3da4fa5aa0 100644 --- a/pdf/src/viewer.js +++ b/pdf/src/viewer.js @@ -3126,6 +3126,7 @@ this._paintFormsHighlight(); this._paintFormsMarkers(); oDoc.UpdateInterface(); + oDoc.UpdateInterfaceTracks(); // Обязательно делаем в конце, т.к. во время отрисовки происходит пересчет this._checkTargetUpdate();