Skip to content

Commit

Permalink
[pdf] Refactor update interface tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
KhromovNikita committed Dec 11, 2024
1 parent 9269972 commit 31d1827
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pdf/src/annotations/annotTrackHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
14 changes: 10 additions & 4 deletions pdf/src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -2796,6 +2796,10 @@ var CPresentation = CPresentation || function(){};
}
}

if (this.Viewer.file.isSelectionUse()) {
return;
}

if (oAnnot) {
this.showedCommentId = oAnnot.GetId();

Expand Down Expand Up @@ -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();
Expand All @@ -3551,6 +3551,12 @@ var CPresentation = CPresentation || function(){};

Asc.editor.CheckChangedDocument();
};
CPDFDoc.prototype.UpdateInterfaceTracks = function() {
this.UpdateCommentPos();
this.UpdateMathTrackPos();
this.UpdateAnnotTrackPos();
this.UpdateSelectionTrackPos();
};

//-----------------------------------------------------------------------------------
// Функции для работы с гиперссылками
Expand Down
1 change: 1 addition & 0 deletions pdf/src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3126,6 +3126,7 @@
this._paintFormsHighlight();
this._paintFormsMarkers();
oDoc.UpdateInterface();
oDoc.UpdateInterfaceTracks();

// Обязательно делаем в конце, т.к. во время отрисовки происходит пересчет
this._checkTargetUpdate();
Expand Down

0 comments on commit 31d1827

Please sign in to comment.