[pdf] Fix dbl click on text

This commit is contained in:
Nikita Khromov
2025-10-14 16:12:15 +07:00
parent a350f90192
commit d92cd22e80
2 changed files with 22 additions and 3 deletions

View File

@ -854,6 +854,8 @@ void main() {\n\
return;
}
let oDoc = this.viewer.getPDFDoc();
stream.pos = ret.LinePos;
let _lineText = "";
@ -914,10 +916,13 @@ void main() {\n\
}
}
oDoc.TextSelectTrackHandler.Update(true);
this.onUpdateSelection();
this.onUpdateOverlay();
};
CFile.prototype.selectWholeRow = function(pageIndex, x, y) {
let ret = this.getNearestPos(pageIndex, x, y);
let oDoc = this.viewer.getPDFDoc();
let sel = this.Selection;
sel.Glyph1 = -2;
@ -929,6 +934,8 @@ void main() {\n\
sel.Page2 = pageIndex;
sel.quads = [];
oDoc.TextSelectTrackHandler.Update(true);
this.onUpdateSelection();
this.onUpdateOverlay();
};
CFile.prototype.selectWholePage = function(pageIndex) {
@ -937,6 +944,9 @@ void main() {\n\
if (!stream) {
return;
}
let oDoc = this.viewer.getPDFDoc();
while (stream.pos < stream.size)
{
_numLine++;
@ -957,6 +967,8 @@ void main() {\n\
sel.Page2 = pageIndex;
sel.quads = [];
oDoc.TextSelectTrackHandler.Update(true);
this.onUpdateSelection();
this.onUpdateOverlay();
};
CFile.prototype.selectAll = function() {

View File

@ -2048,12 +2048,19 @@
if (!pageObjectLogic) {
return false;
}
if (global_mouseEvent.ClickCount == 2)
if (global_mouseEvent.ClickCount == 2) {
oThis.file.selectWholeWord(pageObjectLogic.index, pageObjectLogic.x, pageObjectLogic.y);
else if (global_mouseEvent.ClickCount == 3)
return;
}
else if (global_mouseEvent.ClickCount == 3) {
oThis.file.selectWholeRow(pageObjectLogic.index, pageObjectLogic.x, pageObjectLogic.y);
else if (global_mouseEvent.ClickCount == 4)
return;
}
else if (global_mouseEvent.ClickCount == 4) {
oThis.file.selectWholePage(pageObjectLogic.index);
return;
}
}
// если было нажатие - то отжимаем