Commit bbe10cbc authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

при одновремнном попадании в контур и текст считаем, что попали в текст....

при одновремнном попадании в контур и текст считаем, что попали в текст. добавлен флаг для зачелекченных объетов в isPointInDrawingObjects2.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60670 954022d7-b5bf-4e40-9824-e11837661b57
parent 85127a22
......@@ -69,7 +69,7 @@ function handleSelectedObjects(drawingObjectsController, e, x, y, group, pageInd
tx = x;
ty = y;
}
if(selected_objects[i].hitInBoundingRect(x, y))
if(selected_objects[i].hitInBoundingRect(x, y) && (!selected_objects[i].hitInTextRect || !selected_objects[i].hitInTextRect(x, y)))
{
if(bWord && selected_objects[i].parent && selected_objects[i].parent.Is_Inline())
return handleInlineHitNoText(selected_objects[i], drawingObjectsController, e, x, y, pageIndex);
......@@ -136,7 +136,7 @@ function handleShapeImage(drawing, drawingObjectsController, e, x, y, group, pag
var hit_in_inner_area = drawing.hitInInnerArea(x, y);
var hit_in_path = drawing.hitInPath(x, y);
var hit_in_text_rect = drawing.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
if(!hit_in_text_rect && (hit_in_inner_area || hit_in_path))
{
return drawingObjectsController.handleMoveHit(drawing, e, x, y, group, false, pageIndex, bWord);
}
......@@ -166,7 +166,7 @@ function handleShapeImageInGroup(drawingObjectsController, drawing, shape, e, x,
var hit_in_path = shape.hitInPath && shape.hitInPath(x, y);
var hit_in_text_rect = shape.hitInTextRect && shape.hitInTextRect(x, y);
var ret;
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
if(!hit_in_text_rect && (hit_in_inner_area || hit_in_path))
{
return drawingObjectsController.handleMoveHit(drawing, e, x, y, null, false, pageIndex, true);
}
......@@ -462,10 +462,11 @@ function handleInlineHitNoText(drawing, drawingObjects, e, x, y, pageIndex)
{
if(drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
var bIsSelected = drawing.selected;
drawingObjects.checkChartTextSelection();
drawingObjects.resetSelection();
drawing.select(drawingObjects, pageIndex);
drawingObjects.changeCurrentState(new PreMoveInlineObject(drawingObjects, drawing));
drawingObjects.changeCurrentState(new PreMoveInlineObject(drawingObjects, drawing, bIsSelected, true, pageIndex, x, y));
if(e.ClickCount > 1 && !e.ShiftKey && !e.CtrlKey && ((drawingObjects.selection.groupSelection && drawingObjects.selection.groupSelection.selectedObjects.length === 1) || drawingObjects.selectedObjects.length === 1)
&& drawing.getObjectType() === historyitem_type_ChartSpace && drawingObjects.handleChartDoubleClick)
{
......
......@@ -2231,7 +2231,7 @@ CGraphicObjects.prototype =
this.zIndexManager.addItem(null, paraDrawing);
},
isPointInDrawingObjects: function(x, y, pageIndex)
isPointInDrawingObjects: function(x, y, pageIndex, bSelected)
{
var ret;
this.handleEventMode = HANDLE_EVENT_MODE_CURSOR;
......@@ -2240,7 +2240,7 @@ CGraphicObjects.prototype =
if(isRealObject(ret))
{
var object = g_oTableId.Get_ById(ret.objectId);
if(isRealObject(object))
if(isRealObject(object) && (!(bSelected === true) || bSelected && object.selected) )
{
if(object.group)
object = object.getMainGroup();
......@@ -2258,9 +2258,9 @@ CGraphicObjects.prototype =
return -1;
},
isPointInDrawingObjects2: function(x, y, pageIndex)
isPointInDrawingObjects2: function(x, y, pageIndex, bSelected)
{
return this.isPointInDrawingObjects(x, y, pageIndex) > -1;
return this.isPointInDrawingObjects(x, y, pageIndex, bSelected) > -1;
},
......@@ -2500,6 +2500,68 @@ CGraphicObjects.prototype =
setParagraphIndent: DrawingObjectsController.prototype.setParagraphIndent,
getSelectedObjectsBounds: DrawingObjectsController.prototype.getSelectedObjectsBounds,
getContextMenuPosition: DrawingObjectsController.prototype.getContextMenuPosition,
getLeftTopSelectedFromArray: DrawingObjectsController.prototype.getLeftTopSelectedFromArray,
getLeftTopSelectedObject: function(pageIndex)
{
if(this.selectedObjects.length > 0)
{
var oRes = this.getLeftTopSelectedObjectByPage(pageIndex);
if(oRes.bSelected === true)
{
return oRes;
}
var aSelectedObjectsCopy = [].concat(this.selectedObjects);
aSelectedObjectsCopy.sort(function(a, b){return a.selectStartPage - b.selectStartPage});
return this.getLeftTopSelectedObjectByPage(aSelectedObjectsCopy[0].selectStartPage);
}
return {X: 0, Y: 0};
},
getLeftTopSelectedObjectByPage: function(pageIndex)
{
var oDrawingPage, oRes;
if(this.document.CurPos.Type === docpostype_HdrFtr)
{
if(this.graphicPages[pageIndex])
{
oDrawingPage = this.graphicPages[pageIndex].hdrFtrPage;
}
}
else
{
if(this.graphicPages[pageIndex])
{
oDrawingPage = this.graphicPages[pageIndex];
}
}
if(oDrawingPage)
{
oRes = this.getLeftTopSelectedFromArray(oDrawingPage.beforeTextObjects, pageIndex);
if(oRes.bSelected)
{
return oRes;
}
oRes = this.getLeftTopSelectedFromArray(oDrawingPage.inlineObjects, pageIndex);
if(oRes.bSelected)
{
return oRes;
}
oRes = this.getLeftTopSelectedFromArray(oDrawingPage.wrappingObjects, pageIndex);
if(oRes.bSelected)
{
return oRes;
}
oRes = this.getLeftTopSelectedFromArray(oDrawingPage.behindDocObjects, pageIndex);
if(oRes.bSelected)
{
return oRes;
}
}
return {X: 0, Y: 0};
},
CheckRange: function(X0, Y0, X1, Y1, Y0Sp, Y1Sp, LeftField, RightField, PageNum, HdrFtrRanges, docContent)
......
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