Commit 632dff7b authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bugs of moving cursor up/down in document.

parent ca1af5d9
...@@ -9877,11 +9877,17 @@ CDocument.prototype.private_UpdateCursorXY = function(bUpdateX, bUpdateY) ...@@ -9877,11 +9877,17 @@ CDocument.prototype.private_UpdateCursorXY = function(bUpdateX, bUpdateY)
{ {
NewCursorPos.X = SelectionBounds.Start.X; NewCursorPos.X = SelectionBounds.Start.X;
NewCursorPos.Y = SelectionBounds.Start.Y; NewCursorPos.Y = SelectionBounds.Start.Y;
if (this.CurPage < SelectionBounds.Start.Page)
NewCursorPos.Y = this.Pages[this.CurPage].Height;
} }
else else
{ {
NewCursorPos.X = SelectionBounds.End.X + SelectionBounds.End.W; NewCursorPos.X = SelectionBounds.End.X + SelectionBounds.End.W;
NewCursorPos.Y = SelectionBounds.End.Y + SelectionBounds.End.H; NewCursorPos.Y = SelectionBounds.End.Y + SelectionBounds.End.H;
if (this.CurPage > SelectionBounds.End.Page)
NewCursorPos.Y = 0;
} }
} }
} }
...@@ -10027,6 +10033,7 @@ CDocument.prototype.private_MoveCursorUp = function(StartX, StartY, AddToSelect) ...@@ -10027,6 +10033,7 @@ CDocument.prototype.private_MoveCursorUp = function(StartX, StartY, AddToSelect)
StartY = this.Pages[this.CurPage].Height; StartY = this.Pages[this.CurPage].Height;
var NewPage = this.CurPage; var NewPage = this.CurPage;
var bBreak = false;
while (true) while (true)
{ {
this.Cursor_MoveAt(StartX, StartY, AddToSelect); this.Cursor_MoveAt(StartX, StartY, AddToSelect);
...@@ -10039,10 +10046,15 @@ CDocument.prototype.private_MoveCursorUp = function(StartX, StartY, AddToSelect) ...@@ -10039,10 +10046,15 @@ CDocument.prototype.private_MoveCursorUp = function(StartX, StartY, AddToSelect)
} }
else else
{ {
Result = true;
bBreak = true;
break; break;
} }
} }
if (false === Result || true === bBreak)
break;
CurY = StartY; CurY = StartY;
} }
} }
......
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