Commit 71169c17 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #34402 Added a cursor position correction after adding a equation.

parent 7952793a
......@@ -1560,6 +1560,12 @@ CMathBase.prototype.Correct_Content = function(bInnerCorrection)
{
this.Content[nIndex].Correct_Content(bInnerCorrection);
}
if (this.CurPos >= this.Content.length)
this.CurPos = this.Content.length - 1;
if (this.CurPos < 0)
this.CurPos = 0;
};
CMathBase.prototype.Undo = function(Data)
{
......
......@@ -1765,6 +1765,11 @@ CMathContent.prototype.Correct_Content = function(bInnerCorrection)
if (isEmptyContent)
this.SetPlaceholder();
}
if (this.CurPos >= this.Content.length)
this.CurPos = this.Content.length - 1;
if (this.CurPos < 0)
this.CurPos = 0;
};
CMathContent.prototype.Correct_ContentPos = function(nDirection)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment