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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47840 954022d7-b5bf-4e40-9824-e11837661b57
parent 2a5cfab9
......@@ -1637,8 +1637,9 @@ function CPage()
}
}
function CDrawingDocument()
function CDrawingDocument(drawingObjects)
{
this.drawingObjects = drawingObjects;
this.IsLockObjectsEnable = false;
this.cursorMarkerFormat = "";
......@@ -2994,7 +2995,7 @@ function CDrawingDocument()
if (this.m_bIsSearching && null != this.CurrentSearchNavi)
{
this.CurrentSearchNavi = null;
this.m_oWordControl.OnUpdateOverlay();
this.drawingObjects.OnUpdateOverlay();
}
}
this.UpdateTarget2 = function(x, y, pageIndex)
......@@ -3186,7 +3187,7 @@ function CDrawingDocument()
if (this.m_bIsSearching && null != this.CurrentSearchNavi)
{
this.CurrentSearchNavi = null;
oWordControl.OnUpdateOverlay();
this.drawingObjects.OnUpdateOverlay();
}
}
......@@ -3448,8 +3449,8 @@ function CDrawingDocument()
{
this.SelectClear();
//this.m_oWordControl.CheckUnShowOverlay();
this.m_oWordControl.OnUpdateOverlay();
this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 1.0;
this.drawingObjects.OnUpdateOverlay();
this.drawingObjects.getOverlay().m_oContext.globalAlpha = 1.0;
}
}
this.SelectClear = function()
......@@ -3616,7 +3617,7 @@ function CDrawingDocument()
}
if (is_update)
this.m_oWordControl.OnUpdateOverlay();
this.drawingObjects.OnUpdateOverlay();
}
......@@ -3687,38 +3688,21 @@ function CDrawingDocument()
this.AddPageSelection = function(pageIndex, x, y, w, h)
{
if (pageIndex < this.m_lDrawingFirst || pageIndex > this.m_lDrawingEnd)
{
if (this.m_oWordControl.MobileTouchManager)
/* if (pageIndex < this.m_lDrawingFirst || pageIndex > this.m_lDrawingEnd)
{
var r = new _rect();
r.x = x;
r.y = y;
r.w = w;
r.h = h;
if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
{
this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
}
this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
}
return;
}
} */
var page = this.m_arrPages[pageIndex];
var drawPage = page.drawingPage;
// var page = this.m_arrPages[pageIndex];
// var drawPage = page.drawingPage;
var dKoefX = (drawPage.right - drawPage.left) / page.width_mm;
var dKoefY = (drawPage.bottom - drawPage.top) / page.height_mm;
var dKoefX = this.drawingObjects.convertMetric(1, 3, 0);//(drawPage.right - drawPage.left) / page.width_mm;
var dKoefY = dKoefX;//(drawPage.bottom - drawPage.top) / page.height_mm;
if (!this.IsTextMatrixUse)
{
var _x = ((drawPage.left + dKoefX * x) >> 0) - 0.5;
var _y = ((drawPage.top + dKoefY * y) >> 0) - 0.5;
var _x = ((/*drawPage.left +*/ dKoefX * x) >> 0) - 0.5;
var _y = ((/*drawPage.top + */dKoefY * y) >> 0) - 0.5;
var _w = (dKoefX * w + 1) >> 0;
var _h = (dKoefY * h + 1) >> 0;
......@@ -3740,17 +3724,17 @@ function CDrawingDocument()
var _x4 = this.TextMatrix.TransformPointX(x, y + h);
var _y4 = this.TextMatrix.TransformPointY(x, y + h);
var x1 = drawPage.left + dKoefX * _x1;
var y1 = drawPage.top + dKoefY * _y1;
var x1 = /*drawPage.left +*/ dKoefX * _x1;
var y1 = /*drawPage.top + */dKoefY * _y1;
var x2 = drawPage.left + dKoefX * _x2;
var y2 = drawPage.top + dKoefY * _y2;
var x2 =/*drawPage.left +*/ dKoefX * _x2;
var y2 =/*drawPage.top + */dKoefY * _y2;
var x3 = drawPage.left + dKoefX * _x3;
var y3 = drawPage.top + dKoefY * _y3;
var x3 =/* drawPage.left +*/ dKoefX * _x3;
var y3 =/* drawPage.top + */dKoefY * _y3;
var x4 = drawPage.left + dKoefX * _x4;
var y4 = drawPage.top + dKoefY * _y4;
var x4 = /*drawPage.left +*/ dKoefX * _x4;
var y4 = /*drawPage.top + */dKoefY * _y4;
this.Overlay.CheckPoint(x1, y1);
this.Overlay.CheckPoint(x2, y2);
......@@ -3764,24 +3748,6 @@ function CDrawingDocument()
ctx.lineTo(x4, y4);
ctx.closePath();
}
if (this.m_oWordControl.MobileTouchManager)
{
var r = new _rect();
r.x = x;
r.y = y;
r.w = w;
r.h = h;
if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
{
this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
}
this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
}
}
this.AddPageSelection2 = function(pageIndex, x, y, width, height)
......@@ -3867,7 +3833,7 @@ function CDrawingDocument()
}
this.SelectShow = function()
{
this.m_oWordControl.OnUpdateOverlay();
this.drawingObjects.OnUpdateOverlay();
}
this.Set_RulerState_Table = function(markup, transform)
......
......@@ -247,11 +247,24 @@ DrawingObjectsController.prototype =
this.arrTrackObjects[i].draw(overlay);
},
needUpdateOverlay: function()
{
return this.arrTrackObjects.length > 0;
},
drawSelection: function(drawingDocument)
{
this.curState.drawSelection(drawingDocument);
},
drawTextSelection: function()
{
if(isRealObject(this.curState.textObject) )
{
this.curState.textObject.drawTextSelection();
}
},
isPointInDrawingObjects: function(x, y)
{
return this.curState.isPointInDrawingObjects(x, y);
......
......@@ -895,6 +895,14 @@ CShape.prototype =
}
},
drawTextSelection: function()
{
if(isRealObject(this.txBody))
{
this.txBody.drawTextSelection();
}
},
check_bounds: function(checker)
{
if (this.spPr.geometry)
......@@ -1178,7 +1186,7 @@ CShape.prototype =
t_x = invert_transform.TransformPointX(x, y);
t_y = invert_transform.TransformPointY(x, y);
if(isRealObject(this.spPr.geometry))
return this.spPr.geometry.hitToAdj(t_x, t_y, /*TODO*/ 5);
return this.spPr.geometry.hitToAdj(t_x, t_y, this.drawingObjects.convertMetric(TRACK_CIRCLE_RADIUS, 0, 3));
return {hit: false, adjPolarFlag: null, adjNum: null};
},
......
......@@ -13,7 +13,7 @@ function CTxBody(shape)
this.bodyPr.setDefault();
this.lstStyle = null;
this.content = new CDocumentContent(this, /*editor.WordControl.m_oLogicDocument.DrawingDocument*/undefined, 0, 0, 200, 20000, false, false);
this.content = new CDocumentContent(this, shape.drawingObjects.drawingDocument, 0, 0, 200, 20000, false, false);
this.contentWidth = 0;
this.contentHeight = 0;
......@@ -160,7 +160,6 @@ CTxBody.prototype =
selectionSetStart: function(e, x, y)
{
MouseEvent = new CMouseEventHandler();
this.content.Selection_SetStart(x, y, 0, e);
},
......@@ -184,6 +183,12 @@ CTxBody.prototype =
drawingDocument.UpdateTargetTransform(this.shape.transformText);
drawingDocument.TargetShow();
drawingDocument.SelectEnabled(false);
drawingDocument.CheckTargetShow();
}
},
drawTextSelection: function()
{
this.content.Selection_Draw_Page(0);
}
};
\ No newline at end of file
......@@ -160,7 +160,7 @@ function NullState(drawingObjectsController, drawingObjects)
cur_drawing.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, cur_drawing));
if(e.ClickCount < 2)
this.drawingObjects.selectGraphicObject();
cur_drawing.updateSelectionState(this.drawingObjects.drawingDocument);
return;
}
}
......@@ -351,16 +351,18 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject)
};
this.onMouseMove = function(e, x, y)
{
if(e.which > 0)
{
this.textObject.selectionSetEnd(e, x, y);
this.drawingObjects.selectGraphicObject();
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
}
};
this.onMouseUp = function(e, x, y)
{
this.textObject.selectionSetEnd(e, x, y);
this.drawingObjects.selectGraphicObject();
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
};
this.onKeyDown = function(e)
......@@ -386,7 +388,7 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject)
this.drawSelection = function(drawingDocument)
{
DrawDefaultSelection(this.drawingObjectsController, drawingDocument);
this.textObject.updateSelectionState(drawingDocument);
//this.textObject.updateSelectionState(drawingDocument);
};
this.isPointInDrawingObjects = function(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