Commit a4041006 authored by Oleg Korshul's avatar Oleg Korshul

developinng (retinaScale)

parent ec47628c
...@@ -5253,8 +5253,8 @@ function CSlideDrawer() ...@@ -5253,8 +5253,8 @@ function CSlideDrawer()
if (this.m_oWordControl.bIsRetinaSupport) if (this.m_oWordControl.bIsRetinaSupport)
{ {
_x = (_rect.left * AscCommon.AscBrowser.retinaPixelRatio) + _bounds.min_x; _x = ((_rect.left * AscCommon.AscBrowser.retinaPixelRatio) >> 0) + _bounds.min_x;
_y = (_rect.top * AscCommon.AscBrowser.retinaPixelRatio) + _bounds.min_y; _y = ((_rect.top * AscCommon.AscBrowser.retinaPixelRatio) >> 0) + _bounds.min_y;
} }
if (this.bIsEmptyPresentation) if (this.bIsEmptyPresentation)
......
...@@ -2307,10 +2307,10 @@ function CEditorPage(api) ...@@ -2307,10 +2307,10 @@ function CEditorPage(api)
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
settings.screenW /= AscCommon.AscBrowser.retinaPixelRatio; settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW);
settings.screenH /= AscCommon.AscBrowser.retinaPixelRatio; settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH);
settings.screenAddH /= AscCommon.AscBrowser.retinaPixelRatio; settings.screenAddH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenAddH);
} }
if (this.m_bIsHorScrollVisible) if (this.m_bIsHorScrollVisible)
...@@ -2753,14 +2753,14 @@ function CEditorPage(api) ...@@ -2753,14 +2753,14 @@ function CEditorPage(api)
var _srcH = this.m_oEditor.HtmlElement.height; var _srcH = this.m_oEditor.HtmlElement.height;
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
_srcW /= AscCommon.AscBrowser.retinaPixelRatio; _srcW = (_srcW / AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_srcH /= AscCommon.AscBrowser.retinaPixelRatio; _srcH = (_srcH / AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_bounds_slide = { _bounds_slide = {
min_x : _bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio, min_x : (_bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
min_y : _bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio, min_y : (_bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
max_x : _bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio, max_x : (_bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
max_y : _bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio max_y : (_bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0
}; };
} }
...@@ -2894,14 +2894,14 @@ function CEditorPage(api) ...@@ -2894,14 +2894,14 @@ function CEditorPage(api)
var _srcH = this.m_oEditor.HtmlElement.height; var _srcH = this.m_oEditor.HtmlElement.height;
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
_srcW /= 1; _srcW = (_srcW / AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_srcH /= 1; _srcH = (_srcH / AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_bounds_slide = { _bounds_slide = {
min_x : _bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio, min_x : (_bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
min_y : _bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio, min_y : (_bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
max_x : _bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio, max_x : (_bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
max_y : _bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio max_y : (_bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0
}; };
} }
...@@ -3014,14 +3014,14 @@ function CEditorPage(api) ...@@ -3014,14 +3014,14 @@ function CEditorPage(api)
var _srcH = this.m_oEditor.HtmlElement.height; var _srcH = this.m_oEditor.HtmlElement.height;
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
_srcW /= AscCommon.AscBrowser.retinaPixelRatio; _srcW = (_srcW / AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_srcH /= AscCommon.AscBrowser.retinaPixelRatio; _srcH = (_srcH / AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_bounds_slide = { _bounds_slide = {
min_x : _bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio, min_x : (_bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
min_y : _bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio, min_y : (_bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
max_x : _bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio, max_x : (_bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0,
max_y : _bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio max_y : (_bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0
}; };
} }
......
...@@ -2425,8 +2425,8 @@ function CDrawingDocument() ...@@ -2425,8 +2425,8 @@ function CDrawingDocument()
if (this.m_oWordControl.bIsRetinaSupport) if (this.m_oWordControl.bIsRetinaSupport)
{ {
w *= AscCommon.AscBrowser.retinaPixelRatio; w = AscCommon.AscBrowser.convertToRetinaValue(w, true);
h *= AscCommon.AscBrowser.retinaPixelRatio; h = AscCommon.AscBrowser.convertToRetinaValue(h, true);
} }
var _check = this.CheckPagesSizeMaximum(w, h); var _check = this.CheckPagesSizeMaximum(w, h);
...@@ -5871,8 +5871,8 @@ function CDrawingDocument() ...@@ -5871,8 +5871,8 @@ function CDrawingDocument()
} }
else else
{ {
_canvas_tables.width = (TABLE_STYLE_WIDTH_PIX * AscCommon.AscBrowser.retinaPixelRatio); _canvas_tables.width = (TABLE_STYLE_WIDTH_PIX * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_canvas_tables.height = (TABLE_STYLE_HEIGHT_PIX * AscCommon.AscBrowser.retinaPixelRatio); _canvas_tables.height = (TABLE_STYLE_HEIGHT_PIX * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
} }
} }
...@@ -6609,10 +6609,12 @@ CStylesPainter.prototype = ...@@ -6609,10 +6609,12 @@ CStylesPainter.prototype =
{ {
GenerateStyles: function (_api, ds) GenerateStyles: function (_api, ds)
{ {
var _oldX = this.STYLE_THUMBNAIL_WIDTH;
var _oldY = this.STYLE_THUMBNAIL_HEIGHT;
if (_api.WordControl.bIsRetinaSupport) if (_api.WordControl.bIsRetinaSupport)
{ {
this.STYLE_THUMBNAIL_WIDTH *= AscCommon.AscBrowser.retinaPixelRatio; this.STYLE_THUMBNAIL_WIDTH = AscCommon.AscBrowser.convertToRetinaValue(this.STYLE_THUMBNAIL_WIDTH, true);
this.STYLE_THUMBNAIL_HEIGHT *= AscCommon.AscBrowser.retinaPixelRatio; this.STYLE_THUMBNAIL_HEIGHT = AscCommon.AscBrowser.convertToRetinaValue(this.STYLE_THUMBNAIL_HEIGHT, true);
this.IsRetinaEnabled = true; this.IsRetinaEnabled = true;
} }
...@@ -6678,8 +6680,8 @@ CStylesPainter.prototype = ...@@ -6678,8 +6680,8 @@ CStylesPainter.prototype =
if (_api.WordControl.bIsRetinaSupport) if (_api.WordControl.bIsRetinaSupport)
{ {
this.STYLE_THUMBNAIL_WIDTH /= AscCommon.AscBrowser.retinaPixelRatio; this.STYLE_THUMBNAIL_WIDTH = _oldX;
this.STYLE_THUMBNAIL_HEIGHT /= AscCommon.AscBrowser.retinaPixelRatio; this.STYLE_THUMBNAIL_HEIGHT = _oldY;
} }
// export // export
......
...@@ -1320,8 +1320,8 @@ CGraphics.prototype = ...@@ -1320,8 +1320,8 @@ CGraphics.prototype =
var _yPxOffset = 5; var _yPxOffset = 5;
if (AscBrowser.isRetina) if (AscBrowser.isRetina)
{ {
_xPxOffset *= AscCommon.AscBrowser.retinaPixelRatio; _xPxOffset = (_xPxOffset * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_yPxOffset *= AscCommon.AscBrowser.retinaPixelRatio; _yPxOffset = (_yPxOffset * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
} }
var __x = this.m_oFullTransform.TransformPointX(x, y) >> 0; var __x = this.m_oFullTransform.TransformPointX(x, y) >> 0;
...@@ -1378,8 +1378,8 @@ CGraphics.prototype = ...@@ -1378,8 +1378,8 @@ CGraphics.prototype =
var _yPxOffset = 5; var _yPxOffset = 5;
if (AscBrowser.isRetina) if (AscBrowser.isRetina)
{ {
_xPxOffset *= AscCommon.AscBrowser.retinaPixelRatio; _xPxOffset = (_xPxOffset * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_yPxOffset *= AscCommon.AscBrowser.retinaPixelRatio; _yPxOffset = (_yPxOffset * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
} }
var __x = this.m_oFullTransform.TransformPointX(this.m_dWidthMM - x, y) >> 0; var __x = this.m_oFullTransform.TransformPointX(this.m_dWidthMM - x, y) >> 0;
...@@ -1468,8 +1468,8 @@ CGraphics.prototype = ...@@ -1468,8 +1468,8 @@ CGraphics.prototype =
if (_isRetina) if (_isRetina)
{ {
_w1 *= AscCommon.AscBrowser.retinaPixelRatio; _w1 = (_w1 * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_w2 *= AscCommon.AscBrowser.retinaPixelRatio; _w2 = (_w2 * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
} }
var bIsNoIntGrid = this.m_bIntegerGrid; var bIsNoIntGrid = this.m_bIntegerGrid;
...@@ -1506,7 +1506,7 @@ CGraphics.prototype = ...@@ -1506,7 +1506,7 @@ CGraphics.prototype =
} }
} }
var _fontSize = _isRetina ? (9 * AscCommon.AscBrowser.retinaPixelRatio) : 9; var _fontSize = _isRetina ? ((9 * AscCommon.AscBrowser.retinaPixelRatio) >> 0) : 9;
this.DrawStringASCII("Courier New", _fontSize, false, false, _header_text, 2, yPos, true); this.DrawStringASCII("Courier New", _fontSize, false, false, _header_text, 2, yPos, true);
if (bIsRepeat) if (bIsRepeat)
...@@ -1569,8 +1569,8 @@ CGraphics.prototype = ...@@ -1569,8 +1569,8 @@ CGraphics.prototype =
if (_isRetina) if (_isRetina)
{ {
_w1 *= AscCommon.AscBrowser.retinaPixelRatio; _w1 = (_w1 * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_w2 *= AscCommon.AscBrowser.retinaPixelRatio; _w2 = (_w2 * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
} }
var _wmax = this.m_lWidthPix; var _wmax = this.m_lWidthPix;
...@@ -1609,7 +1609,7 @@ CGraphics.prototype = ...@@ -1609,7 +1609,7 @@ CGraphics.prototype =
} }
} }
var _fontSize = _isRetina ? (9 * AscCommon.AscBrowser.retinaPixelRatio) : 9; var _fontSize = _isRetina ? ((9 * AscCommon.AscBrowser.retinaPixelRatio) >> 0) : 9;
this.DrawStringASCII("Courier New", _fontSize, false, false, _header_text, 2, yPos, false); this.DrawStringASCII("Courier New", _fontSize, false, false, _header_text, 2, yPos, false);
if (bIsRepeat) if (bIsRepeat)
......
...@@ -903,8 +903,8 @@ function CEditorPage(api) ...@@ -903,8 +903,8 @@ function CEditorPage(api)
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
w /= AscCommon.AscBrowser.retinaPixelRatio; w = AscCommon.AscBrowser.convertToRetinaValue(w);
h /= AscCommon.AscBrowser.retinaPixelRatio; h = AscCommon.AscBrowser.convertToRetinaValue(h);
} }
var _hor_Zoom = 100; var _hor_Zoom = 100;
...@@ -2561,8 +2561,8 @@ function CEditorPage(api) ...@@ -2561,8 +2561,8 @@ function CEditorPage(api)
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
settings.screenW /= AscCommon.AscBrowser.retinaPixelRatio; settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW);
settings.screenH /= AscCommon.AscBrowser.retinaPixelRatio; settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH);
} }
if (this.m_oScrollHor_) if (this.m_oScrollHor_)
...@@ -3062,8 +3062,8 @@ function CEditorPage(api) ...@@ -3062,8 +3062,8 @@ function CEditorPage(api)
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
_width /= AscCommon.AscBrowser.retinaPixelRatio; _width = AscCommon.AscBrowser.convertToRetinaValue(_width);
_height /= AscCommon.AscBrowser.retinaPixelRatio; _height = AscCommon.AscBrowser.convertToRetinaValue(_height);
} }
var bIsFoundFirst = false; var bIsFoundFirst = false;
...@@ -3184,10 +3184,10 @@ function CEditorPage(api) ...@@ -3184,10 +3184,10 @@ function CEditorPage(api)
else else
{ {
var _cur_page_rect = new AscCommon._rect(); var _cur_page_rect = new AscCommon._rect();
_cur_page_rect.x = drawPage.left * AscCommon.AscBrowser.retinaPixelRatio; _cur_page_rect.x = (drawPage.left * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_cur_page_rect.y = drawPage.top * AscCommon.AscBrowser.retinaPixelRatio; _cur_page_rect.y = (drawPage.top * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
_cur_page_rect.w = (drawPage.right * AscCommon.AscBrowser.retinaPixelRatio) - _cur_page_rect.x; _cur_page_rect.w = ((drawPage.right * AscCommon.AscBrowser.retinaPixelRatio) >> 0) - _cur_page_rect.x;
_cur_page_rect.h = (drawPage.bottom * AscCommon.AscBrowser.retinaPixelRatio) - _cur_page_rect.y; _cur_page_rect.h = ((drawPage.bottom * AscCommon.AscBrowser.retinaPixelRatio) >> 0) - _cur_page_rect.y;
rectsPages.push(_cur_page_rect); rectsPages.push(_cur_page_rect);
} }
...@@ -3217,10 +3217,10 @@ function CEditorPage(api) ...@@ -3217,10 +3217,10 @@ function CEditorPage(api)
} }
else else
{ {
var __x = drawPage.left * AscCommon.AscBrowser.retinaPixelRatio; var __x = (drawPage.left * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
var __y = drawPage.top * AscCommon.AscBrowser.retinaPixelRatio; var __y = (drawPage.top * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
var __w = (drawPage.right * AscCommon.AscBrowser.retinaPixelRatio) - __x; var __w = ((drawPage.right * AscCommon.AscBrowser.retinaPixelRatio) >> 0) - __x;
var __h = (drawPage.bottom * AscCommon.AscBrowser.retinaPixelRatio) - __y; var __h = ((drawPage.bottom * AscCommon.AscBrowser.retinaPixelRatio) >> 0) - __y;
this.m_oDrawingDocument.m_arrPages[i].Draw(context, __x, __y, __w, __h); this.m_oDrawingDocument.m_arrPages[i].Draw(context, __x, __y, __w, __h);
//this.m_oBoundsController.CheckRect(__x, __y, __w, __h); //this.m_oBoundsController.CheckRect(__x, __y, __w, __h);
} }
...@@ -3249,10 +3249,10 @@ function CEditorPage(api) ...@@ -3249,10 +3249,10 @@ function CEditorPage(api)
var __h = drawPage.bottom - __y; var __h = drawPage.bottom - __y;
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
__x *= AscCommon.AscBrowser.retinaPixelRatio; __x = (__x * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
__y *= AscCommon.AscBrowser.retinaPixelRatio; __y = (__y * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
__w *= AscCommon.AscBrowser.retinaPixelRatio; __w = (__w * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
__h *= AscCommon.AscBrowser.retinaPixelRatio; __h = (__h * AscCommon.AscBrowser.retinaPixelRatio) >> 0;
} }
this.m_oDrawingDocument.CheckRecalculatePage(__w, __h, i); this.m_oDrawingDocument.CheckRecalculatePage(__w, __h, i);
......
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