diff --git a/slide/Drawing/DrawingDocument.js b/slide/Drawing/DrawingDocument.js index a2a00b5234da45ea6c66fd8c083ae1f80f70eaf9..72eac86b6f67745231c70f018589be12d4164508 100644 --- a/slide/Drawing/DrawingDocument.js +++ b/slide/Drawing/DrawingDocument.js @@ -5253,8 +5253,8 @@ function CSlideDrawer() if (this.m_oWordControl.bIsRetinaSupport) { - _x = (_rect.left * AscCommon.AscBrowser.retinaPixelRatio) + _bounds.min_x; - _y = (_rect.top * AscCommon.AscBrowser.retinaPixelRatio) + _bounds.min_y; + _x = ((_rect.left * AscCommon.AscBrowser.retinaPixelRatio) >> 0) + _bounds.min_x; + _y = ((_rect.top * AscCommon.AscBrowser.retinaPixelRatio) >> 0) + _bounds.min_y; } if (this.bIsEmptyPresentation) diff --git a/slide/Drawing/HtmlPage.js b/slide/Drawing/HtmlPage.js index c3699741435828a1b7473e557bd208653ff5d889..5999484ad4fae7d3f321e31d8577e01dd1db3d49 100644 --- a/slide/Drawing/HtmlPage.js +++ b/slide/Drawing/HtmlPage.js @@ -2307,10 +2307,10 @@ function CEditorPage(api) if (this.bIsRetinaSupport) { - settings.screenW /= AscCommon.AscBrowser.retinaPixelRatio; - settings.screenH /= AscCommon.AscBrowser.retinaPixelRatio; + settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW); + settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH); - settings.screenAddH /= AscCommon.AscBrowser.retinaPixelRatio; + settings.screenAddH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenAddH); } if (this.m_bIsHorScrollVisible) @@ -2753,14 +2753,14 @@ function CEditorPage(api) var _srcH = this.m_oEditor.HtmlElement.height; if (this.bIsRetinaSupport) { - _srcW /= AscCommon.AscBrowser.retinaPixelRatio; - _srcH /= AscCommon.AscBrowser.retinaPixelRatio; + _srcW = (_srcW / AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _srcH = (_srcH / AscCommon.AscBrowser.retinaPixelRatio) >> 0; _bounds_slide = { - min_x : _bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio, - min_y : _bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio, - max_x : _bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio, - max_y : _bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio + min_x : (_bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + min_y : (_bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + max_x : (_bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + max_y : (_bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0 }; } @@ -2894,14 +2894,14 @@ function CEditorPage(api) var _srcH = this.m_oEditor.HtmlElement.height; if (this.bIsRetinaSupport) { - _srcW /= 1; - _srcH /= 1; + _srcW = (_srcW / AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _srcH = (_srcH / AscCommon.AscBrowser.retinaPixelRatio) >> 0; _bounds_slide = { - min_x : _bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio, - min_y : _bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio, - max_x : _bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio, - max_y : _bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio + min_x : (_bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + min_y : (_bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + max_x : (_bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + max_y : (_bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0 }; } @@ -3014,14 +3014,14 @@ function CEditorPage(api) var _srcH = this.m_oEditor.HtmlElement.height; if (this.bIsRetinaSupport) { - _srcW /= AscCommon.AscBrowser.retinaPixelRatio; - _srcH /= AscCommon.AscBrowser.retinaPixelRatio; + _srcW = (_srcW / AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _srcH = (_srcH / AscCommon.AscBrowser.retinaPixelRatio) >> 0; _bounds_slide = { - min_x : _bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio, - min_y : _bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio, - max_x : _bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio, - max_y : _bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio + min_x : (_bounds_slide.min_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + min_y : (_bounds_slide.min_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + max_x : (_bounds_slide.max_x / AscCommon.AscBrowser.retinaPixelRatio) >> 0, + max_y : (_bounds_slide.max_y / AscCommon.AscBrowser.retinaPixelRatio) >> 0 }; } diff --git a/word/Drawing/DrawingDocument.js b/word/Drawing/DrawingDocument.js index 000e5450a5b40f55980c0882717e4b11a480d442..b266029332ab4d6b1d34d4a1b53a288030ca4953 100644 --- a/word/Drawing/DrawingDocument.js +++ b/word/Drawing/DrawingDocument.js @@ -2425,8 +2425,8 @@ function CDrawingDocument() if (this.m_oWordControl.bIsRetinaSupport) { - w *= AscCommon.AscBrowser.retinaPixelRatio; - h *= AscCommon.AscBrowser.retinaPixelRatio; + w = AscCommon.AscBrowser.convertToRetinaValue(w, true); + h = AscCommon.AscBrowser.convertToRetinaValue(h, true); } var _check = this.CheckPagesSizeMaximum(w, h); @@ -5871,8 +5871,8 @@ function CDrawingDocument() } else { - _canvas_tables.width = (TABLE_STYLE_WIDTH_PIX * AscCommon.AscBrowser.retinaPixelRatio); - _canvas_tables.height = (TABLE_STYLE_HEIGHT_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) >> 0; } } @@ -6609,10 +6609,12 @@ CStylesPainter.prototype = { GenerateStyles: function (_api, ds) { + var _oldX = this.STYLE_THUMBNAIL_WIDTH; + var _oldY = this.STYLE_THUMBNAIL_HEIGHT; if (_api.WordControl.bIsRetinaSupport) { - this.STYLE_THUMBNAIL_WIDTH *= AscCommon.AscBrowser.retinaPixelRatio; - this.STYLE_THUMBNAIL_HEIGHT *= AscCommon.AscBrowser.retinaPixelRatio; + this.STYLE_THUMBNAIL_WIDTH = AscCommon.AscBrowser.convertToRetinaValue(this.STYLE_THUMBNAIL_WIDTH, true); + this.STYLE_THUMBNAIL_HEIGHT = AscCommon.AscBrowser.convertToRetinaValue(this.STYLE_THUMBNAIL_HEIGHT, true); this.IsRetinaEnabled = true; } @@ -6678,8 +6680,8 @@ CStylesPainter.prototype = if (_api.WordControl.bIsRetinaSupport) { - this.STYLE_THUMBNAIL_WIDTH /= AscCommon.AscBrowser.retinaPixelRatio; - this.STYLE_THUMBNAIL_HEIGHT /= AscCommon.AscBrowser.retinaPixelRatio; + this.STYLE_THUMBNAIL_WIDTH = _oldX; + this.STYLE_THUMBNAIL_HEIGHT = _oldY; } // export diff --git a/word/Drawing/Graphics.js b/word/Drawing/Graphics.js index 55098000590a64f4387443dd8cf75783d9e4b1d1..83b77787b4b7ba6d095b542bf56e095915e2ff6d 100644 --- a/word/Drawing/Graphics.js +++ b/word/Drawing/Graphics.js @@ -1320,8 +1320,8 @@ CGraphics.prototype = var _yPxOffset = 5; if (AscBrowser.isRetina) { - _xPxOffset *= AscCommon.AscBrowser.retinaPixelRatio; - _yPxOffset *= AscCommon.AscBrowser.retinaPixelRatio; + _xPxOffset = (_xPxOffset * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _yPxOffset = (_yPxOffset * AscCommon.AscBrowser.retinaPixelRatio) >> 0; } var __x = this.m_oFullTransform.TransformPointX(x, y) >> 0; @@ -1378,8 +1378,8 @@ CGraphics.prototype = var _yPxOffset = 5; if (AscBrowser.isRetina) { - _xPxOffset *= AscCommon.AscBrowser.retinaPixelRatio; - _yPxOffset *= AscCommon.AscBrowser.retinaPixelRatio; + _xPxOffset = (_xPxOffset * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _yPxOffset = (_yPxOffset * AscCommon.AscBrowser.retinaPixelRatio) >> 0; } var __x = this.m_oFullTransform.TransformPointX(this.m_dWidthMM - x, y) >> 0; @@ -1468,8 +1468,8 @@ CGraphics.prototype = if (_isRetina) { - _w1 *= AscCommon.AscBrowser.retinaPixelRatio; - _w2 *= AscCommon.AscBrowser.retinaPixelRatio; + _w1 = (_w1 * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _w2 = (_w2 * AscCommon.AscBrowser.retinaPixelRatio) >> 0; } var bIsNoIntGrid = this.m_bIntegerGrid; @@ -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); if (bIsRepeat) @@ -1569,8 +1569,8 @@ CGraphics.prototype = if (_isRetina) { - _w1 *= AscCommon.AscBrowser.retinaPixelRatio; - _w2 *= AscCommon.AscBrowser.retinaPixelRatio; + _w1 = (_w1 * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _w2 = (_w2 * AscCommon.AscBrowser.retinaPixelRatio) >> 0; } var _wmax = this.m_lWidthPix; @@ -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); if (bIsRepeat) diff --git a/word/Drawing/HtmlPage.js b/word/Drawing/HtmlPage.js index c0fbe7a7cfc10551dda8db441ff909ee1e3235c1..1431abc2886d2290fd2e47a3091dee95baec2f61 100644 --- a/word/Drawing/HtmlPage.js +++ b/word/Drawing/HtmlPage.js @@ -903,8 +903,8 @@ function CEditorPage(api) if (this.bIsRetinaSupport) { - w /= AscCommon.AscBrowser.retinaPixelRatio; - h /= AscCommon.AscBrowser.retinaPixelRatio; + w = AscCommon.AscBrowser.convertToRetinaValue(w); + h = AscCommon.AscBrowser.convertToRetinaValue(h); } var _hor_Zoom = 100; @@ -2561,8 +2561,8 @@ function CEditorPage(api) if (this.bIsRetinaSupport) { - settings.screenW /= AscCommon.AscBrowser.retinaPixelRatio; - settings.screenH /= AscCommon.AscBrowser.retinaPixelRatio; + settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW); + settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH); } if (this.m_oScrollHor_) @@ -3062,8 +3062,8 @@ function CEditorPage(api) if (this.bIsRetinaSupport) { - _width /= AscCommon.AscBrowser.retinaPixelRatio; - _height /= AscCommon.AscBrowser.retinaPixelRatio; + _width = AscCommon.AscBrowser.convertToRetinaValue(_width); + _height = AscCommon.AscBrowser.convertToRetinaValue(_height); } var bIsFoundFirst = false; @@ -3184,10 +3184,10 @@ function CEditorPage(api) else { var _cur_page_rect = new AscCommon._rect(); - _cur_page_rect.x = drawPage.left * AscCommon.AscBrowser.retinaPixelRatio; - _cur_page_rect.y = drawPage.top * AscCommon.AscBrowser.retinaPixelRatio; - _cur_page_rect.w = (drawPage.right * AscCommon.AscBrowser.retinaPixelRatio) - _cur_page_rect.x; - _cur_page_rect.h = (drawPage.bottom * AscCommon.AscBrowser.retinaPixelRatio) - _cur_page_rect.y; + _cur_page_rect.x = (drawPage.left * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _cur_page_rect.y = (drawPage.top * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + _cur_page_rect.w = ((drawPage.right * AscCommon.AscBrowser.retinaPixelRatio) >> 0) - _cur_page_rect.x; + _cur_page_rect.h = ((drawPage.bottom * AscCommon.AscBrowser.retinaPixelRatio) >> 0) - _cur_page_rect.y; rectsPages.push(_cur_page_rect); } @@ -3217,10 +3217,10 @@ function CEditorPage(api) } else { - var __x = drawPage.left * AscCommon.AscBrowser.retinaPixelRatio; - var __y = drawPage.top * AscCommon.AscBrowser.retinaPixelRatio; - var __w = (drawPage.right * AscCommon.AscBrowser.retinaPixelRatio) - __x; - var __h = (drawPage.bottom * AscCommon.AscBrowser.retinaPixelRatio) - __y; + var __x = (drawPage.left * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + var __y = (drawPage.top * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + var __w = ((drawPage.right * AscCommon.AscBrowser.retinaPixelRatio) >> 0) - __x; + var __h = ((drawPage.bottom * AscCommon.AscBrowser.retinaPixelRatio) >> 0) - __y; this.m_oDrawingDocument.m_arrPages[i].Draw(context, __x, __y, __w, __h); //this.m_oBoundsController.CheckRect(__x, __y, __w, __h); } @@ -3249,10 +3249,10 @@ function CEditorPage(api) var __h = drawPage.bottom - __y; if (this.bIsRetinaSupport) { - __x *= AscCommon.AscBrowser.retinaPixelRatio; - __y *= AscCommon.AscBrowser.retinaPixelRatio; - __w *= AscCommon.AscBrowser.retinaPixelRatio; - __h *= AscCommon.AscBrowser.retinaPixelRatio; + __x = (__x * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + __y = (__y * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + __w = (__w * AscCommon.AscBrowser.retinaPixelRatio) >> 0; + __h = (__h * AscCommon.AscBrowser.retinaPixelRatio) >> 0; } this.m_oDrawingDocument.CheckRecalculatePage(__w, __h, i);