Commit 7eb72e66 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

ретина

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49779 954022d7-b5bf-4e40-9824-e11837661b57
parent f737be55
......@@ -948,7 +948,10 @@ function CBinaryFileWriter()
{
oThis.WriteTable(spTree[i]);
}
// TODO: WriteChart
else if (spTree[i] instanceof CChartAsGroup)
{
oThis.WriteChart(spTree[i]);
}
oThis.EndRecord();
}
......@@ -1997,9 +2000,6 @@ function CBinaryFileWriter()
shape.spPr.WriteXfrm = shape.spPr.xfrm;
var tmpGeom = shape.spPr.Geometry;
shape.spPr.Geometry = shape.geometry;
var tmpFill = shape.spPr.Fill;
var isUseTmpFill = false;
if (tmpFill !== undefined && tmpFill != null)
......@@ -2020,7 +2020,6 @@ function CBinaryFileWriter()
oThis.WriteRecord2(2, shape.style, oThis.WriteShapeStyle);
oThis.WriteRecord2(3, shape.txBody, oThis.WriteTxBody);
shape.spPr.Geometry = tmpGeom;
if (isUseTmpFill)
{
shape.spPr.Fill = tmpFill;
......@@ -2039,10 +2038,10 @@ function CBinaryFileWriter()
image.spPr.WriteXfrm = image.spPr.xfrm;
if (image.spPr.Geometry === undefined || image.spPr.Geometry == null)
if (image.spPr.geometry === undefined || image.spPr.geometry == null)
{
// powerpoint!
image.spPr.Geometry = CreateGeometry("rect");
image.spPr.geometry = CreateGeometry("rect");
}
oThis.WriteRecord1(1, image.blipFill, oThis.WriteUniFill);
......@@ -2444,9 +2443,9 @@ function CBinaryFileWriter()
}
oThis.WriteRecord2(0, spPr.WriteXfrm, oThis.WriteXfrm);
oThis.WriteRecord1(1, spPr.Geometry, oThis.WriteGeometry);
oThis.WriteRecord2(1, spPr.geometry, oThis.WriteGeometry);
if (spPr.Geometry === undefined || spPr.Geometry == null)
if (spPr.geometry === undefined || spPr.geometry == null)
{
if (bIsExistFill || bIsExistLn)
{
......
......@@ -21,7 +21,8 @@
}
}
window.USER_AGENT_SAFARI_MACOS = (navigator.userAgent.toLowerCase().indexOf('safari') > -1 && navigator.userAgent.toLowerCase().indexOf('mac') > -1) ? true : false;
window.USER_AGENT_MACOS = (navigator.userAgent.toLowerCase().indexOf('mac') > -1) ? true : false;
window.USER_AGENT_SAFARI_MACOS = (navigator.userAgent.toLowerCase().indexOf('safari') > -1 && window.USER_AGENT_MACOS) ? true : false;
if (window.USER_AGENT_SAFARI_MACOS)
{
// браузеры под мак все определяются как сафари
......@@ -30,6 +31,7 @@ if (window.USER_AGENT_SAFARI_MACOS)
window.USER_AGENT_SAFARI_MACOS = false;
}
window.USER_AGENT_IE = ((/MSIE/g.test(navigator.userAgent)) || window.opera) ? true : false;
window.USER_AGENT_WEBKIT = (navigator.userAgent.toLowerCase().indexOf('webkit') > -1) ? true : false;
window.GlobalPasteFlagCounter = 0;
......@@ -239,8 +241,7 @@ function Editor_Copy(api, bCut)
{
//�������� � webkit: ���� ���������� ����� ���� ��������, �� ���������� ������ ��� ������������
//������ ��� docs.google ����������� ��� � ��� <b>
var is_webkit = navigator.userAgent.toLowerCase().indexOf('webkit') > -1;
if(is_webkit && (true !== window.USER_AGENT_SAFARI_MACOS))
if(window.USER_AGENT_WEBKIT && (true !== window.USER_AGENT_SAFARI_MACOS))
{
var aChildNodes = ElemToSelect.childNodes;
if(aChildNodes.length == 1)
......
......@@ -2784,7 +2784,7 @@ function CDrawingDocument()
ctx.stroke();
}
if (!oThis.m_oWordControl.MobileTouchManager)
if ((!oThis.m_oWordControl.MobileTouchManager && !window.USER_AGENT_SAFARI_MACOS) || !window.USER_AGENT_WEBKIT)
{
this.TargetHtmlElement.style.left = Math.min(pos1.X, pos2.X) + "px";
this.TargetHtmlElement.style.top = Math.min(pos1.Y, pos2.Y) + "px";
......@@ -2795,7 +2795,6 @@ function CDrawingDocument()
var __y = Math.min(pos1.Y, pos2.Y);
oThis.TargetHtmlElement.style.left = "0px";
oThis.TargetHtmlElement.style.top = "0px";
//oThis.TargetHtmlElement.style.webkitTransform = "translate(" + __x + "px," + __y + "px)";
oThis.TargetHtmlElement.style["webkitTransform"] = "matrix(1, 0, 0, 1, " +__x + "," + __y + ")";
}
}
......@@ -2828,7 +2827,7 @@ function CDrawingDocument()
var pos = this.ConvertCoordsToCursor2(x, y, this.m_lCurrentPage);
if (!oThis.m_oWordControl.MobileTouchManager)
if (!oThis.m_oWordControl.MobileTouchManager && !window.USER_AGENT_SAFARI_MACOS)
{
this.TargetHtmlElement.style.left = pos.X + "px";
this.TargetHtmlElement.style.top = pos.Y + "px";
......@@ -2837,7 +2836,6 @@ function CDrawingDocument()
{
oThis.TargetHtmlElement.style.left = "0px";
oThis.TargetHtmlElement.style.top = "0px";
//oThis.TargetHtmlElement.style.webkitTransform = "translate(" + pos.X + "px," + pos.Y + "px)";
oThis.TargetHtmlElement.style["webkitTransform"] = "matrix(1, 0, 0, 1, " + pos.X + "," + pos.Y + ")";
}
......@@ -5095,8 +5093,17 @@ function CDrawingDocument()
Grid[i] = W / Cols;
var _canvas = document.createElement('canvas');
_canvas.width = TABLE_STYLE_WIDTH_PIX;
_canvas.height = TABLE_STYLE_HEIGHT_PIX;
if (!this.m_oWordControl.bIsRetinaSupport)
{
_canvas.width = TABLE_STYLE_WIDTH_PIX;
_canvas.height = TABLE_STYLE_HEIGHT_PIX;
}
else
{
_canvas.width = (TABLE_STYLE_WIDTH_PIX << 1);
_canvas.height = (TABLE_STYLE_HEIGHT_PIX << 1);
}
var ctx = _canvas.getContext('2d');
History.TurnOff();
......@@ -5133,7 +5140,7 @@ function CDrawingDocument()
}
History.TurnOn();
this.m_oWordControl.m_oApi.sync_InitEditorTableStyles(_dst_styles);
this.m_oWordControl.m_oApi.sync_InitEditorTableStyles(_dst_styles, this.m_oWordControl.bIsRetinaSupport);
}
this.IsMobileVersion = function()
......@@ -5607,9 +5614,17 @@ function CStylesPainter()
this.STYLE_THUMBNAIL_HEIGHT = 40;
this.CurrentTranslate = null;
this.IsRetinaEnabled = false;
this.GenerateStyles = function(_api, ds)
{
if (_api.WordControl.bIsRetinaSupport)
{
this.STYLE_THUMBNAIL_WIDTH <<= 1;
this.STYLE_THUMBNAIL_HEIGHT <<= 1;
this.IsRetinaEnabled = true;
}
this.CurrentTranslate = _api.CurrentTranslate;
this.GenerateDefaultStyles(_api, ds);
......
......@@ -504,6 +504,8 @@ function CGraphics()
this.IsUseFonts2 = false;
this.m_oFontManager2 = null;
this.m_oLastFont2 = null;
this.ClearMode = false;
}
CGraphics.prototype =
......
......@@ -2036,13 +2036,29 @@ function CEditorPage(api)
}
var oWordControl = oThis;
if (false === oWordControl.m_oApi.bInit_word_control || oWordControl.m_bIsMouseLock === true)
if (false === oWordControl.m_oApi.bInit_word_control)
{
check_KeyboardEvent2(e);
e.preventDefault();
return;
}
if (oWordControl.m_bIsMouseLock === true)
{
if (!window.USER_AGENT_MACOS)
{
check_KeyboardEvent2(e);
e.preventDefault();
return;
}
// на масОс есть мега выделение на трекпаде. там моусАп приходит с задержкой.
// нужно лдибо копить команды клавиатуры, либо насильно заранее сделать моусАп самому.
// мы выбараем второе
oWordControl.onMouseUpExternal(global_mouseEvent.X, global_mouseEvent.Y);
}
check_KeyboardEvent(e);
if (oWordControl.IsFocus === false)
......@@ -3062,7 +3078,7 @@ function CEditorPage(api)
{
if (this.bIsRetinaSupport)
{
if (htmlElem.id == "id_viewer")
if (htmlElem.id == "id_viewer" || htmlElem.id == "id_hor_ruler" || htmlElem.id == "id_vert_ruler")
return true;
}
return false;
......
This diff is collapsed.
......@@ -449,6 +449,7 @@ CStylesPainter.prototype.get_DocStylesImage = function() { return this.docStyles
CStylesPainter.prototype.get_MergedStyles = function() { return this.mergedStyles; }
CStylesPainter.prototype.get_STYLE_THUMBNAIL_WIDTH = function() { return this.STYLE_THUMBNAIL_WIDTH; }
CStylesPainter.prototype.get_STYLE_THUMBNAIL_HEIGHT = function() { return this.STYLE_THUMBNAIL_HEIGHT; }
CStylesPainter.prototype.get_IsRetinaEnabled = function() { return this.IsRetinaEnabled; }
CStyleImage.prototype.get_ThumbnailOffset = function() { return this.ThumbnailOffset; }
CStyleImage.prototype.get_Type = function() { return this.Type; }
......@@ -3242,8 +3243,8 @@ asc_docs_api.prototype.sync_InitEditorStyles = function(styles_painter){
if (ret)
this._gui_styles = null;
}
asc_docs_api.prototype.sync_InitEditorTableStyles = function(styles){
this.asc_fireCallback("asc_onInitTableTemplates",styles);
asc_docs_api.prototype.sync_InitEditorTableStyles = function(styles, is_retina_enabled){
this.asc_fireCallback("asc_onInitTableTemplates",styles, is_retina_enabled);
}
......
......@@ -924,8 +924,16 @@ function GenerateTableStyles(drawingDoc, logicDoc, tableLook)
Grid[i] = W / Cols;
var _canvas = document.createElement('canvas');
_canvas.width = TABLE_STYLE_WIDTH_PIX;
_canvas.height = TABLE_STYLE_HEIGHT_PIX;
if (!this.m_oWordControl.bIsRetinaSupport)
{
_canvas.width = TABLE_STYLE_WIDTH_PIX;
_canvas.height = TABLE_STYLE_HEIGHT_PIX;
}
else
{
_canvas.width = (TABLE_STYLE_WIDTH_PIX << 1);
_canvas.height = (TABLE_STYLE_HEIGHT_PIX << 1);
}
var ctx = _canvas.getContext('2d');
History.TurnOff();
......
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