Commit 4ef87d14 authored by Oleg Korshul's avatar Oleg Korshul

mobile version. input & bugs

parent 39092b60
......@@ -942,7 +942,7 @@
this.TimeDown = new Date().getTime();
var bIsKoefPixToMM = false;
var _matrix = this.DrawingDocument.TextMatrix;
var _matrix = this.DrawingDocument.SelectionMatrix;
if (_matrix && global_MatrixTransformer.IsIdentity(_matrix))
_matrix = null;
......@@ -1941,7 +1941,7 @@
if (null != this.RectSelect1 && null != this.RectSelect2 && !this.HtmlPage.m_oApi.isViewMode)
{
var _matrix = this.DrawingDocument.TextMatrix;
var _matrix = this.DrawingDocument.SelectionMatrix;
var pos1 = null;
var pos4 = null;
......@@ -2038,7 +2038,7 @@
var pos1 = null;
var pos4 = null;
var _matrix = this.DrawingDocument.TextMatrix;
var _matrix = this.DrawingDocument.SelectionMatrix;
if (!_matrix || global_MatrixTransformer.IsIdentity(_matrix))
{
pos1 = this.DrawingDocument.ConvertCoordsToCursorWR(this.RectSelect1.x, this.RectSelect1.y, this.PageSelect1);
......@@ -2068,7 +2068,7 @@
if (null == this.RectSelect1 || null == this.RectSelect2)
return;
var _matrix = this.DrawingDocument.TextMatrix;
var _matrix = this.DrawingDocument.SelectionMatrix;
if (!_matrix || global_MatrixTransformer.IsIdentity(_matrix))
{
......@@ -2179,7 +2179,7 @@
if (null == this.RectSelect1 || null == this.RectSelect2)
return;
var _matrix = this.DrawingDocument.TextMatrix;
var _matrix = this.DrawingDocument.SelectionMatrix;
if (!_matrix || global_MatrixTransformer.IsIdentity(_matrix))
{
......@@ -2558,6 +2558,8 @@
return;
var _table_markup = horRuler.m_oTableMarkup;
if (_table_markup.Rows.length == 0)
return;
this.HtmlPage.CheckShowOverlay();
......
......@@ -3039,10 +3039,20 @@ function CEditorPage(api)
this.m_oApi.syncOnThumbnailsShow();
if (!this.m_oApi.isMobileVersion)
{
AscCommon.InitBrowserInputContext(this.m_oApi, "id_target_cursor");
if (AscCommon.g_inputContext)
AscCommon.g_inputContext.onResize("id_main_view");
}
else
{
window.onkeydown = this.onKeyDown;
window.onkeypress = this.onKeyPress;
window.onkeyup = this.onKeyUp;
window['AscCommon'].g_clipboardBase.Init(api);
}
};
this.StartMainTimer = function()
......
......@@ -2032,6 +2032,8 @@ function CDrawingDocument()
this.TargetShowFlag = false;
this.TargetShowNeedFlag = false;
this.SelectionMatrix = null;
this.CanvasHit = document.createElement('canvas');
this.CanvasHit.width = 10;
this.CanvasHit.height = 10;
......@@ -2636,7 +2638,7 @@ function CDrawingDocument()
var x_mm = (_x - rect.left) * dKoef;
var y_mm = (_y - rect.top) * dKoef;
return { X : x_mm, Y : y_mm, Page: rect.pageIndex, DrawPage: i };
return { X : x_mm, Y : y_mm, Page: rect.pageIndex, DrawPage: page };
}
this.ConvertCoordsToAnotherPage = function(x, y, pageCoord, pageNeed)
......@@ -4394,6 +4396,9 @@ function CDrawingDocument()
this.AddPageSelection = function(pageIndex, x, y, w, h)
{
if (null == this.SelectionMatrix)
this.SelectionMatrix = this.TextMatrix;
this.IsTextMatrixUse = ((null != this.TextMatrix) && !global_MatrixTransformer.IsIdentity(this.TextMatrix));
if (pageIndex < this.m_lDrawingFirst || pageIndex > this.m_lDrawingEnd)
......
......@@ -1417,7 +1417,11 @@ CGraphics.prototype =
var _w2 = 3;
var _lineWidth = 1;
if (AscBrowser.isRetina)
var _isRetina = AscBrowser.isRetina;
if (_isRetina && !editor.WordControl.bIsRetinaSupport)
_isRetina = false;
if (_isRetina)
{
_y >>= 0;
_lineWidth = 2;
......@@ -1456,7 +1460,7 @@ CGraphics.prototype =
}
}
if (AscBrowser.isRetina)
if (_isRetina)
{
_w1 <<= 1;
_w2 <<= 1;
......@@ -1496,10 +1500,10 @@ CGraphics.prototype =
}
}
this.DrawStringASCII("Courier New", AscBrowser.isRetina ? 18 : 9, false, false, _header_text, 2, yPos, true);
this.DrawStringASCII("Courier New", _isRetina ? 18 : 9, false, false, _header_text, 2, yPos, true);
if (bIsRepeat)
this.DrawStringASCII2("Courier New", AscBrowser.isRetina ? 18 : 9, false, false, "Same as Previous", 2, yPos, true);
this.DrawStringASCII2("Courier New", _isRetina ? 18 : 9, false, false, "Same as Previous", 2, yPos, true);
if (false == bIsNoIntGrid)
this.SetIntegerGrid(false);
......@@ -1514,7 +1518,11 @@ CGraphics.prototype =
var _w2 = 3;
var _lineWidth = 1;
if (AscBrowser.isRetina)
var _isRetina = AscBrowser.isRetina;
if (_isRetina && !editor.WordControl.bIsRetinaSupport)
_isRetina = false;
if (_isRetina)
{
_y >>= 0;
_lineWidth = 2;
......@@ -1552,7 +1560,7 @@ CGraphics.prototype =
}
}
if (AscBrowser.isRetina)
if (_isRetina)
{
_w1 <<= 1;
_w2 <<= 1;
......@@ -1594,10 +1602,10 @@ CGraphics.prototype =
}
}
this.DrawStringASCII("Courier New", AscBrowser.isRetina ? 18 : 9, false, false, _header_text, 2, yPos, false);
this.DrawStringASCII("Courier New", _isRetina ? 18 : 9, false, false, _header_text, 2, yPos, false);
if (bIsRepeat)
this.DrawStringASCII2("Courier New", AscBrowser.isRetina ? 18 : 9, false, false, "Same as Previous", 2, yPos, false);
this.DrawStringASCII2("Courier New", _isRetina ? 18 : 9, false, false, "Same as Previous", 2, yPos, false);
if (false == bIsNoIntGrid)
this.SetIntegerGrid(false);
......
......@@ -3022,6 +3022,7 @@ function CEditorPage(api)
var ctx = overlay.m_oContext;
var drDoc = this.m_oDrawingDocument;
drDoc.SelectionMatrix = null;
if (drDoc.m_lDrawingFirst < 0 || drDoc.m_lDrawingEnd < 0)
return true;
......@@ -3675,9 +3676,20 @@ function CEditorPage(api)
window["AutoTester"]["RunTest"]();
}
if (!this.m_oApi.isMobileVersion)
{
AscCommon.InitBrowserInputContext(this.m_oApi, "id_target_cursor");
if (AscCommon.g_inputContext)
AscCommon.g_inputContext.onResize("id_main_view");
}
else
{
window.onkeydown = this.onKeyDown;
window.onkeypress = this.onKeyPress;
window.onkeyup = this.onKeyUp;
window['AscCommon'].g_clipboardBase.Init(api);
}
//this.m_oDrawingDocument.CheckFontCache();
};
......
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