Skip to content

Commit

Permalink
Fix bug #66376
Browse files Browse the repository at this point in the history
Fix an issue with calculating the current cursor position in some cases
  • Loading branch information
KirillovIlya committed Feb 6, 2024
1 parent 3e39691 commit 6fd00e1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions word/Editor/Paragraph/position-calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@
};
ParagraphPositionCalculator.prototype.getXY = function()
{
this.bidi.end();
this.finalize();
return {x : this.posInfo.x, y : this.posInfo.y};
};
ParagraphPositionCalculator.prototype.getTargetXY = function()
{
this.bidi.end();
this.finalize();
let run = this.posInfo.run;
if (!run)
return {x : this.posInfo.x, y : this.posInfo.y, h : 0, ascent : 0};
Expand Down Expand Up @@ -362,6 +362,17 @@
ParagraphPositionCalculator.prototype.finalize = function()
{
this.bidi.end();

if (this.isNextCurrent)
{
this.posInfo.x = this.x;
this.posInfo.y = this.y;
this.posInfo.run = this.nextRun;

this.isNextCurrent = false;
this.nextRun = null;
}

return !!this.posInfo.run;
};
//--------------------------------------------------------export----------------------------------------------------
Expand Down

0 comments on commit 6fd00e1

Please sign in to comment.