Commit 377c5aab authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Selection_Check (курсор в селекте или нет)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52568 954022d7-b5bf-4e40-9824-e11837661b57
parent dc2636d6
......@@ -7565,13 +7565,11 @@ ParaMath.prototype =
Selection_SetStart : function(X, Y, PageNum)
{
this.Math.Selection_SetStart( X, Y, PageNum );
//console.log("Selection_SetStart");
},
Selection_SetEnd : function(X, Y, PageNum, MouseEvent)
{
this.Math.Selection_SetEnd( X, Y, PageNum, MouseEvent );
//console.log("Selection_SetEnd");
},
Selection_Beginning : function(bStart)
......@@ -7587,16 +7585,11 @@ ParaMath.prototype =
Selection_Draw : function()
{
this.Math.Selection_Draw();
console.log("Selection_Draw");
},
Selection_IsEmpty : function()
{
var empty = this.Math.Selection_IsEmpty();
console.log("Selection_IsEmpty("+empty+")");
//return false;
return empty;
return this.Math.Selection_IsEmpty();
},
Selection_Remove : function()
......@@ -7606,7 +7599,9 @@ ParaMath.prototype =
Selection_Check : function(X, Y, Page_Abs)
{
return false;
var check = this.Math.Selection_Check(X, Y);
console.log("Selection_Check: "+ check);
return check;
},
Copy : function()
......
......@@ -5859,6 +5859,30 @@ CMathContent.prototype =
this.RealPosSelect.end = this.content.length - 1;
this.setEndPos_Selection(this.content.length - 1);
}
},
selection_check: function(X, Y)
{
var flag = false;
var x = X - this.pos.x,
y = Y - this.pos.y;
var bWidth = x >=0 && x <= this.size.width, // попали в контент по ширине
bHeight = y >=0 && y <= this.size.height, // попали в контент по высоте
bSelect = this.selectUse();
if(bSelect && bWidth && bHeight)
{
var start = this.selection.startPos,
end = this.selection.endPos;
var beforeSelect = this.content[start - 1].widthToEl,
afterSelect = this.content[end].widthToEl + this.content[end].g_mContext.right;
flag = beforeSelect <= x && x <= afterSelect;
}
return flag;
}
}
//todo
......@@ -6599,6 +6623,10 @@ CMathComposition.prototype =
Selection_IsEmpty: function()
{
return !this.SelectContent.selectUse();
},
Selection_Check: function(X, Y)
{
return this.SelectContent.selection_check(X, Y);
}
}
......
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