Commit 78dd56b3 authored by Oleg Korshul's avatar Oleg Korshul

.

parent 0ce8e30b
...@@ -1592,6 +1592,8 @@ ...@@ -1592,6 +1592,8 @@
global_mouseEvent.ClickCount = 1; global_mouseEvent.ClickCount = 1;
var nearPos = this.delegate.Logic_GetNearestPos(pos.X, pos.Y, pos.Page); var nearPos = this.delegate.Logic_GetNearestPos(pos.X, pos.Y, pos.Page);
if (!nearPos)
return;
this.delegate.DrawingDocument.NeedScrollToTargetFlag = true; this.delegate.DrawingDocument.NeedScrollToTargetFlag = true;
var y = nearPos.Y; var y = nearPos.Y;
......
...@@ -1434,6 +1434,27 @@ function CDrawingDocument() ...@@ -1434,6 +1434,27 @@ function CDrawingDocument()
return {X : x_pix, Y : y_pix, Error : false}; return {X : x_pix, Y : y_pix, Error : false};
} }
this.ConvertCoordsToCursor3 = function (x, y, isGlobal)
{
var dKoef = (this.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix / 100);
var _x = 0;
var _y = 0;
if (isGlobal)
{
_x = this.m_oWordControl.X;
_y = this.m_oWordControl.Y;
_x += (this.m_oWordControl.m_oMainContent.AbsolutePosition.L + this.m_oWordControl.m_oMainView.AbsolutePosition.L) * g_dKoef_mm_to_pix;
_y += (this.m_oWordControl.m_oMainContent.AbsolutePosition.T + this.m_oWordControl.m_oMainView.AbsolutePosition.T) * g_dKoef_mm_to_pix;
}
var x_pix = (this.SlideCurrectRect.left + x * dKoef + _x) >> 0;
var y_pix = (this.SlideCurrectRect.top + y * dKoef + _y) >> 0;
return {X: x_pix, Y: y_pix, Error: false};
}
this.ConvertCoordsToCursorWR_2 = function(x, y) this.ConvertCoordsToCursorWR_2 = function(x, y)
{ {
var _word_control = this.m_oWordControl; var _word_control = this.m_oWordControl;
......
...@@ -679,9 +679,12 @@ function CEditorPage(api) ...@@ -679,9 +679,12 @@ function CEditorPage(api)
window.onkeyup = this.onKeyUp; window.onkeyup = this.onKeyUp;
*/ */
this.m_oBody.HtmlElement.onmousemove = this.onBodyMouseMove; if (!this.m_oApi.isMobileVersion)
this.m_oBody.HtmlElement.onmousedown = this.onBodyMouseDown; {
this.m_oBody.HtmlElement.onmouseup = this.onBodyMouseUp; this.m_oBody.HtmlElement.onmousemove = this.onBodyMouseMove;
this.m_oBody.HtmlElement.onmousedown = this.onBodyMouseDown;
this.m_oBody.HtmlElement.onmouseup = this.onBodyMouseUp;
}
this.initEvents2MobileAdvances(); this.initEvents2MobileAdvances();
......
...@@ -51,11 +51,7 @@ ...@@ -51,11 +51,7 @@
CMobileDelegateEditorPresentation.prototype.ConvertCoordsToCursor = function(x, y, page, isGlobal) CMobileDelegateEditorPresentation.prototype.ConvertCoordsToCursor = function(x, y, page, isGlobal)
{ {
return this.DrawingDocument.ConvertCoordsToCursor(x, y); return this.DrawingDocument.ConvertCoordsToCursor3(x, y, isGlobal);
if (isGlobal)
return this.DrawingDocument.ConvertCoordsToCursor(x, y);
else
return this.DrawingDocument.ConvertCoordsToCursorWR(x, y);
}; };
CMobileDelegateEditorPresentation.prototype.ConvertCoordsFromCursor = function(x, y) CMobileDelegateEditorPresentation.prototype.ConvertCoordsFromCursor = function(x, y)
{ {
...@@ -233,6 +229,11 @@ ...@@ -233,6 +229,11 @@
return { X : _posX, Y : _posY, Mode : _mode }; return { X : _posX, Y : _posY, Mode : _mode };
}; };
CMobileDelegateEditorPresentation.prototype.Logic_GetNearestPos = function(x, y, page)
{
return this.LogicDocument.Slides[this.LogicDocument.CurPage].graphicObjects.getNearestPos(x, y);
};
/** /**
* @extends {AscCommon.CMobileTouchManagerBase} * @extends {AscCommon.CMobileTouchManagerBase}
*/ */
...@@ -843,6 +844,54 @@ ...@@ -843,6 +844,54 @@
return ret; return ret;
}; };
CMobileTouchManager.prototype.CheckSelectTrack = function()
{
// сдвиг относительно табнейлов => нужно переопределить
if (!this.SelectEnabled)
return false;
var _matrix = this.delegate.GetSelectionTransform();
if (_matrix && global_MatrixTransformer.IsIdentity(_matrix))
_matrix = null;
// проверим на попадание в селект - это может произойти на любом mode
if (null != this.RectSelect1 && null != this.RectSelect2)
{
var pos1 = null;
var pos4 = null;
if (!_matrix)
{
pos1 = this.delegate.ConvertCoordsToCursor(this.RectSelect1.x, this.RectSelect1.y, this.PageSelect1, true);
pos4 = this.delegate.ConvertCoordsToCursor(this.RectSelect2.x + this.RectSelect2.w, this.RectSelect2.y + this.RectSelect2.h, this.PageSelect2, true);
}
else
{
var _xx1 = _matrix.TransformPointX(this.RectSelect1.x, this.RectSelect1.y);
var _yy1 = _matrix.TransformPointY(this.RectSelect1.x, this.RectSelect1.y);
var _xx2 = _matrix.TransformPointX(this.RectSelect2.x + this.RectSelect2.w, this.RectSelect2.y + this.RectSelect2.h);
var _yy2 = _matrix.TransformPointY(this.RectSelect2.x + this.RectSelect2.w, this.RectSelect2.y + this.RectSelect2.h);
pos1 = this.delegate.ConvertCoordsToCursor(_xx1, _yy1, this.PageSelect1, true);
pos4 = this.delegate.ConvertCoordsToCursor(_xx2, _yy2, this.PageSelect2, true);
}
if (Math.abs(pos1.X - global_mouseEvent.X) < this.TrackTargetEps && Math.abs(pos1.Y - global_mouseEvent.Y) < this.TrackTargetEps)
{
this.Mode = AscCommon.MobileTouchMode.Select;
this.DragSelect = 1;
}
else if (Math.abs(pos4.X - global_mouseEvent.X) < this.TrackTargetEps && Math.abs(pos4.Y - global_mouseEvent.Y) < this.TrackTargetEps)
{
this.Mode = AscCommon.MobileTouchMode.Select;
this.DragSelect = 2;
}
}
return (this.Mode == AscCommon.MobileTouchMode.Select);
};
/**************************************************************************/ /**************************************************************************/
/** /**
* @extends {AscCommon.CMobileDelegateSimple} * @extends {AscCommon.CMobileDelegateSimple}
......
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