Commit 2b081824 authored by Oleg.Korshul's avatar Oleg.Korshul

select mobile

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58921 954022d7-b5bf-4e40-9824-e11837661b57
parent 795cdc5a
......@@ -589,6 +589,12 @@ function CDrawingDocument()
// table track
this.TableOutlineDr = new CTableOutlineDr();
this.IsRetina = false;
this.IsMobile = false;
this.SelectRect1 = null;
this.SelectRect2 = null;
}
var _table_styles = null;
......@@ -856,6 +862,29 @@ CDrawingDocument.prototype =
{
// none
},
CheckSelectMobile : function()
{
this.SelectRect1 = null;
this.SelectRect2 = null;
var _select = this.LogicDocument.Get_SelectionBounds();
if (!_select)
return;
var _rect1 = _select.Start;
var _rect2 = _select.End;
if (!_rect1 || !_rect2)
return;
this.SelectRect1 = _rect1;
this.SelectRect2 = _rect2;
this.Native["DD_DrawMobileSelection"](_rect1.X, _rect1.Y, _rect1.W, _rect1.H, _rect1.Page,
_rect2.X, _rect2.Y, _rect2.W, _rect2.H, _rect2.Page);
},
SelectShow : function()
{
this.OnUpdateOverlay();
......@@ -1120,7 +1149,7 @@ CDrawingDocument.prototype =
IsMobileVersion : function()
{
return false;
return this.IsMobile;
},
DrawVerAnchor : function(pageNum, xPos)
......@@ -1198,6 +1227,9 @@ CDrawingDocument.prototype =
}
this.Native["DD_Overlay_EndDrawSelection"]();
if (this.IsMobile)
this.CheckSelectMobile();
}
var _table_outline = this.TableOutlineDr.TableOutline;
......
......@@ -4885,6 +4885,16 @@ asc_docs_api.prototype["Native_Editor_Initialize_Settings"] = function(_params)
TABLE_STYLE_HEIGHT_PIX = _params[_current.pos++];
break;
}
case 100:
{
this.WordControl.m_oDrawingDocument.IsRetina = _params[_current.pos++];
break;
}
case 101:
{
this.WordControl.m_oDrawingDocument.IsMobile = _params[_current.pos++];
break;
}
case 255:
default:
{
......
......@@ -2480,13 +2480,13 @@ function CDrawingDocument()
return false;
}
this.ConvertCoordsToCursorWR = function(x, y, pageIndex, transform)
this.ConvertCoordsToCursorWR = function(x, y, pageIndex, transform, id_ruler_no_use)
{
var dKoef = (this.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix / 100);
var _x = 0;
var _y = 0;
if (true == this.m_oWordControl.m_bIsRuler)
if (true == this.m_oWordControl.m_bIsRuler && (id_ruler_no_use !== false))
{
_x = 5 * g_dKoef_mm_to_pix;
_y = 7 * g_dKoef_mm_to_pix;
......@@ -3969,6 +3969,122 @@ function CDrawingDocument()
}
}
this.CheckSelectMobile = function(overlay)
{
var _select = this.m_oWordControl.m_oLogicDocument.Get_SelectionBounds();
if (!_select)
return;
var _rect1 = _select.Start;
var _rect2 = _select.End;
if (!_rect1 || !_rect2)
return;
var _matrix = this.TextMatrix;
var ctx = overlay.m_oContext;
var pos1, pos2, pos3, pos4;
if (!_matrix || global_MatrixTransformer.IsIdentity(_matrix))
{
pos1 = this.ConvertCoordsToCursorWR(_rect1.X, _rect1.Y, _rect1.Page, undefined, false);
pos2 = this.ConvertCoordsToCursorWR(_rect1.X, _rect1.Y + _rect1.H, _rect1.Page, undefined, false);
pos3 = this.ConvertCoordsToCursorWR(_rect2.X + _rect2.W, _rect2.Y, _rect2.Page, undefined, false);
pos4 = this.ConvertCoordsToCursorWR(_rect2.X + _rect2.W, _rect2.Y + _rect2.H, _rect2.Page, undefined, false);
ctx.strokeStyle = "#1B63BA";
ctx.moveTo(pos1.X >> 0, pos1.Y >> 0);
ctx.lineTo(pos2.X >> 0, pos2.Y >> 0);
ctx.moveTo(pos3.X >> 0, pos3.Y >> 0);
ctx.lineTo(pos4.X >> 0, pos4.Y >> 0);
ctx.lineWidth = 2;
ctx.stroke();
/*
ctx.beginPath();
ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
overlay.AddEllipse(pos1.X, pos1.Y - 5, 6.5);
overlay.AddEllipse(pos4.X, pos4.Y + 5, 6.5);
ctx.fill();
ctx.beginPath();
ctx.fillStyle = "#FFFFFF";
overlay.AddEllipse(pos1.X, pos1.Y - 5, 6);
overlay.AddEllipse(pos4.X, pos4.Y + 5, 6);
ctx.fill();
*/
ctx.beginPath();
ctx.fillStyle = "#1B63BA";
overlay.AddEllipse(pos1.X, pos1.Y - 5, 5);
overlay.AddEllipse(pos4.X, pos4.Y + 5, 5);
ctx.fill();
}
else
{
var _xx11 = _matrix.TransformPointX(_rect1.X, _rect1.Y);
var _yy11 = _matrix.TransformPointY(_rect1.X, _rect1.Y);
var _xx12 = _matrix.TransformPointX(_rect1.X, _rect1.Y + _rect1.H);
var _yy12 = _matrix.TransformPointY(_rect1.X, _rect1.Y + _rect1.H);
var _xx21 = _matrix.TransformPointX(_rect2.X + _rect2.W, _rect2.Y);
var _yy21 = _matrix.TransformPointY(_rect2.X + _rect2.W, _rect2.Y);
var _xx22 = _matrix.TransformPointX(_rect2.X + _rect2.W, _rect2.Y + _rect2.H);
var _yy22 = _matrix.TransformPointY(_rect2.X + _rect2.W, _rect2.Y + _rect2.H);
pos1 = this.ConvertCoordsToCursorWR(_xx11, _yy11, _rect1.Page, undefined, false);
pos2 = this.ConvertCoordsToCursorWR(_xx12, _yy12, _rect1.Page, undefined, false);
pos3 = this.ConvertCoordsToCursorWR(_xx21, _yy21, _rect2.Page, undefined, false);
pos4 = this.ConvertCoordsToCursorWR(_xx22, _yy22, _rect2.Page, undefined, false);
ctx.strokeStyle = "#1B63BA";
ctx.moveTo(pos1.X, pos1.Y);
ctx.lineTo(pos2.X, pos2.Y);
ctx.moveTo(pos3.X, pos3.Y);
ctx.lineTo(pos4.X, pos4.Y);
ctx.lineWidth = 2;
ctx.stroke();
/*
ctx.beginPath();
ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
overlay.AddEllipse(pos1.X, pos1.Y - 5, 6.5);
overlay.AddEllipse(pos4.X, pos4.Y + 5, 6.5);
ctx.fill();
ctx.beginPath();
ctx.fillStyle = "#FFFFFF";
overlay.AddEllipse(pos1.X, pos1.Y - 5, 6);
overlay.AddEllipse(pos4.X, pos4.Y + 5, 6);
ctx.fill();
*/
ctx.beginPath();
ctx.fillStyle = "#1B63BA";
overlay.AddEllipse(pos1.X, pos1.Y - 5, 5);
overlay.AddEllipse(pos4.X, pos4.Y + 5, 5);
ctx.fill();
}
}
this.AddPageSelection2 = function(pageIndex, x, y, width, height)
{
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
......
......@@ -8044,7 +8044,7 @@ CDocument.prototype =
}
else if ( docpostype_DrawingObjects === this.CurPos.Type )
{
return this.DrawingObjects.Get_SelectionBounds();
return null;//this.DrawingObjects.Get_SelectionBounds();
}
else
{
......
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