Commit f7e8076a authored by SergeyLuzyanin's avatar SergeyLuzyanin

replace isPointInDrawingObjects to IsInDrawingObject

parent ad79ceeb
...@@ -5062,7 +5062,7 @@ CDocument.prototype.Selection_SetStart = function(X, Y, MouseEvent) ...@@ -5062,7 +5062,7 @@ CDocument.prototype.Selection_SetStart = function(X, Y, MouseEvent)
var bInText = (null === this.IsInText(X, Y, this.CurPage) ? false : true); var bInText = (null === this.IsInText(X, Y, this.CurPage) ? false : true);
var bTableBorder = (null === this.IsTableBorder(X, Y, this.CurPage) ? false : true); var bTableBorder = (null === this.IsTableBorder(X, Y, this.CurPage) ? false : true);
var nInDrawing = this.DrawingObjects.isPointInDrawingObjects(X, Y, this.CurPage, this); var nInDrawing = this.DrawingObjects.IsInDrawingObject(X, Y, this.CurPage, this);
var bFlowTable = (null === this.DrawingObjects.getTableByXY(X, Y, this.CurPage, this) ? false : true); var bFlowTable = (null === this.DrawingObjects.getTableByXY(X, Y, this.CurPage, this) ? false : true);
// Сначала посмотрим, попалили мы в текстовый селект (но при этом не в границу таблицы и не более чем одинарным кликом) // Сначала посмотрим, попалили мы в текстовый селект (но при этом не в границу таблицы и не более чем одинарным кликом)
...@@ -6002,7 +6002,7 @@ CDocument.prototype.IsTableBorder = function(X, Y, PageIndex) ...@@ -6002,7 +6002,7 @@ CDocument.prototype.IsTableBorder = function(X, Y, PageIndex)
} }
else else
{ {
if (-1 != this.DrawingObjects.isPointInDrawingObjects(X, Y, PageIndex, this)) if (-1 != this.DrawingObjects.IsInDrawingObject(X, Y, PageIndex, this))
{ {
return null; return null;
} }
...@@ -6070,7 +6070,7 @@ CDocument.prototype.IsInDrawing = function(X, Y, PageIndex) ...@@ -6070,7 +6070,7 @@ CDocument.prototype.IsInDrawing = function(X, Y, PageIndex)
} }
else else
{ {
if (-1 != this.DrawingObjects.isPointInDrawingObjects(X, Y, this.CurPage, this)) if (-1 != this.DrawingObjects.IsInDrawingObject(X, Y, this.CurPage, this))
{ {
return true; return true;
} }
...@@ -7177,7 +7177,7 @@ CDocument.prototype.OnMouseUp = function(e, X, Y, PageIndex) ...@@ -7177,7 +7177,7 @@ CDocument.prototype.OnMouseUp = function(e, X, Y, PageIndex)
// Сначала проверим попадание в Flow-таблицы и автофигуры // Сначала проверим попадание в Flow-таблицы и автофигуры
var pFlowTable = this.DrawingObjects.getTableByXY(X, Y, PageIndex, this); var pFlowTable = this.DrawingObjects.getTableByXY(X, Y, PageIndex, this);
var nInDrawing = this.DrawingObjects.isPointInDrawingObjects(X, Y, PageIndex, this); var nInDrawing = this.DrawingObjects.IsInDrawingObject(X, Y, PageIndex, this);
if (docpostype_HdrFtr != this.CurPos.Type && -1 === nInDrawing && null === pFlowTable) if (docpostype_HdrFtr != this.CurPos.Type && -1 === nInDrawing && null === pFlowTable)
{ {
...@@ -7423,7 +7423,7 @@ CDocument.prototype.Get_NearestPos = function(PageNum, X, Y, bAnchor, Drawing) ...@@ -7423,7 +7423,7 @@ CDocument.prototype.Get_NearestPos = function(PageNum, X, Y, bAnchor, Drawing)
return this.HdrFtr.Get_NearestPos(PageNum, X, Y, bAnchor, Drawing); return this.HdrFtr.Get_NearestPos(PageNum, X, Y, bAnchor, Drawing);
var bInText = (null === this.IsInText(X, Y, PageNum) ? false : true); var bInText = (null === this.IsInText(X, Y, PageNum) ? false : true);
var nInDrawing = this.DrawingObjects.isPointInDrawingObjects(X, Y, PageNum, this); var nInDrawing = this.DrawingObjects.IsInDrawingObject(X, Y, PageNum, this);
if (true != bAnchor) if (true != bAnchor)
{ {
......
...@@ -434,7 +434,7 @@ CDocumentContent.prototype.Get_NearestPos = function(CurPage, X, Y, bAnchor, Dra ...@@ -434,7 +434,7 @@ CDocumentContent.prototype.Get_NearestPos = function(CurPage, X, Y, bAnchor, Dra
if (this.Parent && this.Parent instanceof CHeaderFooter) if (this.Parent && this.Parent instanceof CHeaderFooter)
{ {
var bInText = (null === this.IsInText(X, Y, CurPage) ? false : true); var bInText = (null === this.IsInText(X, Y, CurPage) ? false : true);
var nInDrawing = this.LogicDocument.DrawingObjects.isPointInDrawingObjects(X, Y, PageAbs, this); var nInDrawing = this.LogicDocument.DrawingObjects.IsInDrawingObject(X, Y, PageAbs, this);
if (true != bAnchor) if (true != bAnchor)
{ {
...@@ -1646,7 +1646,7 @@ CDocumentContent.prototype.IsInText = function(X, Y, CurPage) ...@@ -1646,7 +1646,7 @@ CDocumentContent.prototype.IsInText = function(X, Y, CurPage)
}; };
CDocumentContent.prototype.IsInDrawing = function(X, Y, CurPage) CDocumentContent.prototype.IsInDrawing = function(X, Y, CurPage)
{ {
if (-1 != this.DrawingObjects.isPointInDrawingObjects(X, Y, this.Get_AbsolutePage(CurPage), this)) if (-1 != this.DrawingObjects.IsInDrawingObject(X, Y, this.Get_AbsolutePage(CurPage), this))
{ {
return true; return true;
} }
...@@ -6381,7 +6381,7 @@ CDocumentContent.prototype.Selection_SetStart = function(X, Y, CurPage, MouseEve ...@@ -6381,7 +6381,7 @@ CDocumentContent.prototype.Selection_SetStart = function(X, Y, CurPage, MouseEve
// Сначала проверим, не попали ли мы в один из "плавающих" объектов // Сначала проверим, не попали ли мы в один из "плавающих" объектов
var bInText = (null === this.IsInText(X, Y, AbsPage) ? false : true); var bInText = (null === this.IsInText(X, Y, AbsPage) ? false : true);
var bTableBorder = (null === this.IsTableBorder(X, Y, AbsPage) ? false : true); var bTableBorder = (null === this.IsTableBorder(X, Y, AbsPage) ? false : true);
var nInDrawing = this.LogicDocument && this.LogicDocument.DrawingObjects.isPointInDrawingObjects(X, Y, AbsPage, this); var nInDrawing = this.LogicDocument && this.LogicDocument.DrawingObjects.IsInDrawingObject(X, Y, AbsPage, this);
if (this.Parent instanceof CHeaderFooter && ( nInDrawing === DRAWING_ARRAY_TYPE_BEFORE || nInDrawing === DRAWING_ARRAY_TYPE_INLINE || ( false === bTableBorder && false === bInText && nInDrawing >= 0 ) )) if (this.Parent instanceof CHeaderFooter && ( nInDrawing === DRAWING_ARRAY_TYPE_BEFORE || nInDrawing === DRAWING_ARRAY_TYPE_INLINE || ( false === bTableBorder && false === bInText && nInDrawing >= 0 ) ))
{ {
......
...@@ -3010,6 +3010,27 @@ CGraphicObjects.prototype = ...@@ -3010,6 +3010,27 @@ CGraphicObjects.prototype =
return this.maximalGraphicObjectZIndex; return this.maximalGraphicObjectZIndex;
}, },
IsInDrawingObject: function(X, Y, nPageIndex, oContent){
var _X, _Y, oTransform, oInvertTransform;
if(oContent){
oTransform = oContent.Get_ParentTextTransform();
if(oTransform){
oInvertTransform = AscCommon.global_MatrixTransformer.Invert(oTransform);
_X = oInvertTransform.TransformPointX(X, Y);
_Y = oInvertTransform.TransformPointY(X, Y);
}
else{
_X = X;
_Y = Y;
}
}
else{
_X = X;
_Y = Y;
}
return this.isPointInDrawingObjects(_X, _Y, nPageIndex);
},
isPointInDrawingObjects: function(x, y, pageIndex, bSelected, bNoText) isPointInDrawingObjects: function(x, y, pageIndex, bSelected, bNoText)
{ {
var ret; var ret;
......
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