Commit 6c1021f0 authored by Ilya.Kirillov's avatar Ilya.Kirillov

Исправлен баг, что при drag-n-drop не зацеплялся 1 символ.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58972 954022d7-b5bf-4e40-9824-e11837661b57
parent c51991a7
...@@ -3512,9 +3512,10 @@ Paragraph.prototype = ...@@ -3512,9 +3512,10 @@ Paragraph.prototype =
} }
}, },
Get_ParaContentPosByXY : function(X, Y, PageNum, bYLine, StepEnd) Get_ParaContentPosByXY : function(X, Y, PageNum, bYLine, StepEnd, bCenterMode)
{ {
var SearchPos = new CParagraphSearchPosXY(); var SearchPos = new CParagraphSearchPosXY();
SearchPos.CenterMode = (undefined === bCenterMode ? true : bCenterMode);
if ( this.Lines.length <= 0 ) if ( this.Lines.length <= 0 )
return SearchPos; return SearchPos;
...@@ -5861,7 +5862,7 @@ Paragraph.prototype = ...@@ -5861,7 +5862,7 @@ Paragraph.prototype =
if ( PageIndex < 0 || PageIndex >= this.Pages.length || true != this.Selection.Use ) if ( PageIndex < 0 || PageIndex >= this.Pages.length || true != this.Selection.Use )
return false; return false;
var SearchPosXY = this.Get_ParaContentPosByXY( X, Y, PageIndex + this.PageNum, false, false ); var SearchPosXY = this.Get_ParaContentPosByXY( X, Y, PageIndex + this.PageNum, false, false, false );
if ( true === SearchPosXY.InText ) if ( true === SearchPosXY.InText )
{ {
...@@ -12713,6 +12714,7 @@ function CParagraphSearchPosXY() ...@@ -12713,6 +12714,7 @@ function CParagraphSearchPosXY()
this.Pos = new CParagraphContentPos(); this.Pos = new CParagraphContentPos();
this.InTextPos = new CParagraphContentPos(); this.InTextPos = new CParagraphContentPos();
this.CenterMode = true; // Ищем ближайший (т.е. ориентируемся по центру элемента), или ищем именно прохождение через элемент
this.CurX = 0; this.CurX = 0;
this.CurY = 0; this.CurY = 0;
this.X = 0; this.X = 0;
......
...@@ -3729,7 +3729,7 @@ ParaRun.prototype.Cursor_MoveToEndPos = function(SelectFromEnd) ...@@ -3729,7 +3729,7 @@ ParaRun.prototype.Cursor_MoveToEndPos = function(SelectFromEnd)
} }
}; };
ParaRun.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine, _CurRange, StepEnd, PointsInfo) ParaRun.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine, _CurRange, StepEnd)
{ {
var Result = false; var Result = false;
...@@ -3766,7 +3766,7 @@ ParaRun.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine, ...@@ -3766,7 +3766,7 @@ ParaRun.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine,
// Проверяем, попали ли мы в данный элемент // Проверяем, попали ли мы в данный элемент
var Diff = SearchPos.X - SearchPos.CurX; var Diff = SearchPos.X - SearchPos.CurX;
if (Math.abs( Diff ) < SearchPos.DiffX + 0.001 && !bNotUpdate) if ((Math.abs( Diff ) < SearchPos.DiffX + 0.001 && (SearchPos.CenterMode || SearchPos.X > SearchPos.CurX)) && !bNotUpdate)
{ {
SearchPos.DiffX = Math.abs( Diff ); SearchPos.DiffX = Math.abs( Diff );
SearchPos.Pos.Update( CurPos, Depth ); SearchPos.Pos.Update( CurPos, Depth );
...@@ -4533,14 +4533,12 @@ ParaRun.prototype.Selection_CheckParaContentPos = function(ContentPos, Depth, bS ...@@ -4533,14 +4533,12 @@ ParaRun.prototype.Selection_CheckParaContentPos = function(ContentPos, Depth, bS
if (this.Selection.StartPos <= this.Selection.EndPos && this.Selection.StartPos <= CurPos && CurPos <= this.Selection.EndPos) if (this.Selection.StartPos <= this.Selection.EndPos && this.Selection.StartPos <= CurPos && CurPos <= this.Selection.EndPos)
{ {
if (((true !== bEnd) || (true === bEnd && CurPos !== this.Selection.EndPos)) && if ((true !== bEnd) || (true === bEnd && CurPos !== this.Selection.EndPos))
((true !== bStart) || (true === bStart && CurPos !== this.Selection.StartPos)))
return true; return true;
} }
else if (this.Selection.StartPos > this.Selection.EndPos && this.Selection.EndPos <= CurPos && CurPos <= this.Selection.StartPos) else if (this.Selection.StartPos > this.Selection.EndPos && this.Selection.EndPos <= CurPos && CurPos <= this.Selection.StartPos)
{ {
if (((true !== bEnd) || (true === bEnd && CurPos !== this.Selection.StartPos)) && if ((true !== bEnd) || (true === bEnd && CurPos !== this.Selection.StartPos))
((true !== bStart) || (true === bStart && CurPos !== this.Selection.EndPos)))
return true; return true;
} }
......
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