Commit fc4fbf69 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поддержка retina в стилях

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56830 954022d7-b5bf-4e40-9824-e11837661b57
parent 903ed327
...@@ -1194,12 +1194,19 @@ ...@@ -1194,12 +1194,19 @@
this.styleThumbnailHeight = 18; this.styleThumbnailHeight = 18;
this.styleThumbnailWidthPt = this.styleThumbnailWidth * 72 / 96; this.styleThumbnailWidthPt = this.styleThumbnailWidth * 72 / 96;
this.styleThumbnailHeightPt = this.styleThumbnailHeight * 72 / 96; this.styleThumbnailHeightPt = this.styleThumbnailHeight * 72 / 96;
this.styleThumbnailWidthWithRetina = this.styleThumbnailWidth;
this.styleThumbnailHeightWithRetina = this.styleThumbnailHeight;
if (AscBrowser.IsRetinaEnabled) {
this.styleThumbnailWidthWithRetina <<= 1;
this.styleThumbnailHeightWithRetina <<= 1;
}
} }
asc_CStylesPainter.prototype = { asc_CStylesPainter.prototype = {
constructor: asc_CStylesPainter, constructor: asc_CStylesPainter,
asc_getStyleThumbnailWidth: function () { return this.styleThumbnailWidth; }, asc_getStyleThumbnailWidth: function () { return this.styleThumbnailWidthWithRetina; },
asc_getStyleThumbnailHeight: function () { return this.styleThumbnailHeight; }, asc_getStyleThumbnailHeight: function () { return this.styleThumbnailHeightWithRetina; },
asc_getDefaultStyles: function () { return this.defaultStyles; }, asc_getDefaultStyles: function () { return this.defaultStyles; },
asc_getDocStyles: function () { return this.docStyles; }, asc_getDocStyles: function () { return this.docStyles; },
asc_getDefaultStylesImage: function () { return this.defaultStylesImage; }, asc_getDefaultStylesImage: function () { return this.defaultStylesImage; },
...@@ -1213,8 +1220,8 @@ ...@@ -1213,8 +1220,8 @@
var cellStyles = cellStylesAll.DefaultStyles; var cellStyles = cellStylesAll.DefaultStyles;
var nLength = cellStyles.length; var nLength = cellStyles.length;
var oCanvas = document.createElement('canvas'); var oCanvas = document.createElement('canvas');
oCanvas.width = this.styleThumbnailWidth; oCanvas.width = this.styleThumbnailWidthWithRetina;
oCanvas.height = nDefaultStylesCount * this.styleThumbnailHeight; oCanvas.height = nDefaultStylesCount * this.styleThumbnailHeightWithRetina;
var ctx = oCanvas.getContext('2d'); var ctx = oCanvas.getContext('2d');
ctx.fillStyle = "#FFFFFF"; ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, oCanvas.width, oCanvas.height); ctx.fillRect(0, 0, oCanvas.width, oCanvas.height);
...@@ -1239,8 +1246,8 @@ ...@@ -1239,8 +1246,8 @@
var cellStyles = cellStylesAll.CustomStyles; var cellStyles = cellStylesAll.CustomStyles;
var nLength = cellStyles.length; var nLength = cellStyles.length;
var oCanvas = document.createElement('canvas'); var oCanvas = document.createElement('canvas');
oCanvas.width = this.styleThumbnailWidth; oCanvas.width = this.styleThumbnailWidthWithRetina;
oCanvas.height = nDocumentStylesCount * this.styleThumbnailHeight; oCanvas.height = nDocumentStylesCount * this.styleThumbnailHeightWithRetina;
var ctx = oCanvas.getContext('2d'); var ctx = oCanvas.getContext('2d');
ctx.fillStyle = "#FFFFFF"; ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, oCanvas.width, oCanvas.height); ctx.fillRect(0, 0, oCanvas.width, oCanvas.height);
......
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