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

mobile version. input & bugs

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