Commit 7b22fbfb authored by Ilya Kirillov's avatar Ilya Kirillov

If on the end of composite input the length of input is equal 0, then point of...

If on the end of composite input the length of input is equal 0, then point of the history with this input will be deleted.
parent 3b5c7bab
......@@ -11289,12 +11289,20 @@ CDocument.prototype.End_CompositeInput = function()
if (null === this.CompositeInput)
return;
var nLen = this.CompositeInput.Length;
var oRun = this.CompositeInput.Run;
oRun.Set_CompositeInput(null);
this.CompositeInput = null;
this.History.Check_UninonLastPoints();
if (0 === nLen && true === this.History.CanRemoveLastPoint())
{
this.Document_Undo();
this.History.Clear_Redo();
}
this.Document_UpdateInterfaceState();
this.DrawingDocument.ClearCachePages();
......
......@@ -733,6 +733,16 @@ CHistory.prototype =
}
},
CanRemoveLastPoint : function()
{
if (this.Points.length <= 0
|| (true !== this.Is_UserSaveMode() && null !== this.SavedIndex && this.SavedIndex >= this.Points.length - 1)
|| (true === this.Is_UserSaveMode() && null !== this.UserSavedIndex && this.UserSavedIndex >= this.Points.length - 1))
return false;
return true;
},
TurnOff : function()
{
this.TurnOffHistory++;
......
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