Commit 4b5c7319 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@67788 954022d7-b5bf-4e40-9824-e11837661b57
parent 8c1c738a
...@@ -1708,15 +1708,26 @@ CGraphics.prototype = ...@@ -1708,15 +1708,26 @@ CGraphics.prototype =
_ctx.fillStyle = "#E1E1E1"; _ctx.fillStyle = "#E1E1E1";
_ctx.strokeStyle = GlobalSkin.RulerOutline; _ctx.strokeStyle = GlobalSkin.RulerOutline;
var _xPxOffset = 10;
var _yPxOffset = 5;
if (AscBrowser.isRetina)
{
_xPxOffset <<= 1;
_yPxOffset <<= 1;
}
var __x = this.m_oFullTransform.TransformPointX(x, y) >> 0; var __x = this.m_oFullTransform.TransformPointX(x, y) >> 0;
var __y = this.m_oFullTransform.TransformPointY(x, y) >> 0; var __y = this.m_oFullTransform.TransformPointY(x, y) >> 0;
var __w = (measure.fWidth >> 0) + 20; var __w = (measure.fWidth >> 0) + 2 * _xPxOffset;
var __h = (measure.fHeight >> 0) + 10; var __h = (Math.abs(measure.fY) >> 0) + 2 * _yPxOffset;
if (!bIsHeader) if (!bIsHeader)
__y -= __h; __y -= __h;
_ctx.rect(__x + 0.5, __y + 0.5, __w, __h); if (!AscBrowser.isRetina)
_ctx.rect(__x + 0.5, __y + 0.5, __w, __h);
else
_ctx.rect(__x, __y, __w, __h);
_ctx.fill(); _ctx.fill();
_ctx.stroke(); _ctx.stroke();
...@@ -1727,9 +1738,9 @@ CGraphics.prototype = ...@@ -1727,9 +1738,9 @@ CGraphics.prototype =
var _koef_px_to_mm = 25.4 / this.m_dDpiY; var _koef_px_to_mm = 25.4 / this.m_dDpiY;
if (bIsHeader) if (bIsHeader)
this.t(text, x + 10 * _koef_px_to_mm, y + (__h - 5) * _koef_px_to_mm); this.t(text, x + _xPxOffset * _koef_px_to_mm, y + (__h - _yPxOffset) * _koef_px_to_mm);
else else
this.t(text, x + 10 * _koef_px_to_mm, y - 5 * _koef_px_to_mm); this.t(text, x + _xPxOffset * _koef_px_to_mm, y - _yPxOffset * _koef_px_to_mm);
}, },
DrawStringASCII2 : function(name, size, bold, italic, text, x, y, bIsHeader) DrawStringASCII2 : function(name, size, bold, italic, text, x, y, bIsHeader)
...@@ -1755,16 +1766,27 @@ CGraphics.prototype = ...@@ -1755,16 +1766,27 @@ CGraphics.prototype =
_ctx.fillStyle = "#E1E1E1"; _ctx.fillStyle = "#E1E1E1";
_ctx.strokeStyle = GlobalSkin.RulerOutline; _ctx.strokeStyle = GlobalSkin.RulerOutline;
var _xPxOffset = 10;
var _yPxOffset = 5;
if (AscBrowser.isRetina)
{
_xPxOffset <<= 1;
_yPxOffset <<= 1;
}
var __x = this.m_oFullTransform.TransformPointX(this.m_dWidthMM - x, y) >> 0; var __x = this.m_oFullTransform.TransformPointX(this.m_dWidthMM - x, y) >> 0;
var __y = this.m_oFullTransform.TransformPointY(this.m_dWidthMM - x, y) >> 0; var __y = this.m_oFullTransform.TransformPointY(this.m_dWidthMM - x, y) >> 0;
var __w = (measure.fWidth >> 0) + 20; var __w = (measure.fWidth >> 0) + 2 * _xPxOffset;
var __h = (measure.fHeight >> 0) + 10; var __h = (Math.abs(measure.fY) >> 0) + 2 * _yPxOffset;
__x -= __w; __x -= __w;
if (!bIsHeader) if (!bIsHeader)
__y -= __h; __y -= __h;
_ctx.rect(__x + 0.5, __y + 0.5, __w, __h); if (!AscBrowser.isRetina)
_ctx.rect(__x + 0.5, __y + 0.5, __w, __h);
else
_ctx.rect(__x, __y, __w, __h);
_ctx.fill(); _ctx.fill();
_ctx.stroke(); _ctx.stroke();
...@@ -1774,12 +1796,12 @@ CGraphics.prototype = ...@@ -1774,12 +1796,12 @@ CGraphics.prototype =
var _koef_px_to_mm = 25.4 / this.m_dDpiY; var _koef_px_to_mm = 25.4 / this.m_dDpiY;
var xPos = this.m_dWidthMM - x - (__w - 10) * _koef_px_to_mm; var xPos = this.m_dWidthMM - x - (__w - _xPxOffset) * _koef_px_to_mm;
if (bIsHeader) if (bIsHeader)
this.t(text, xPos, y + (__h - 5) * _koef_px_to_mm); this.t(text, xPos, y + (__h - _yPxOffset) * _koef_px_to_mm);
else else
this.t(text, xPos, y - 5 * _koef_px_to_mm); this.t(text, xPos, y - _yPxOffset * _koef_px_to_mm);
}, },
DrawHeaderEdit : function(yPos, lock_type, sectionNum, bIsRepeat, type) DrawHeaderEdit : function(yPos, lock_type, sectionNum, bIsRepeat, type)
...@@ -1792,6 +1814,14 @@ CGraphics.prototype = ...@@ -1792,6 +1814,14 @@ CGraphics.prototype =
var _w1 = 6; var _w1 = 6;
var _w2 = 3; var _w2 = 3;
var _lineWidth = 1;
if (AscBrowser.isRetina)
{
_y >>= 0;
_lineWidth = 2;
}
var ctx = this.m_oContext; var ctx = this.m_oContext;
switch (lock_type) switch (lock_type)
...@@ -1803,14 +1833,14 @@ CGraphics.prototype = ...@@ -1803,14 +1833,14 @@ CGraphics.prototype =
//ctx.lineWidth = 2; //ctx.lineWidth = 2;
// GlobalSkin.RulerOutline // GlobalSkin.RulerOutline
this.p_color(0xBB, 0xBE, 0xC2, 255); this.p_color(0xBB, 0xBE, 0xC2, 255);
ctx.lineWidth = 1; ctx.lineWidth = _lineWidth;
break; break;
} }
case locktype_Other: case locktype_Other:
case locktype_Other2: case locktype_Other2:
{ {
this.p_color(238, 53, 37, 255); this.p_color(238, 53, 37, 255);
ctx.lineWidth = 1; ctx.lineWidth = _lineWidth;
_w1 = 2; _w1 = 2;
_w2 = 1; _w2 = 1;
break; break;
...@@ -1818,12 +1848,18 @@ CGraphics.prototype = ...@@ -1818,12 +1848,18 @@ CGraphics.prototype =
default: default:
{ {
this.p_color(155, 187, 277, 255); this.p_color(155, 187, 277, 255);
ctx.lineWidth = 2; ctx.lineWidth = _lineWidth;
_w1 = 2; _w1 = 2;
_w2 = 1; _w2 = 1;
} }
} }
if (AscBrowser.isRetina)
{
_w1 <<= 1;
_w2 <<= 1;
}
var bIsNoIntGrid = this.m_bIntegerGrid; var bIsNoIntGrid = this.m_bIntegerGrid;
if (false == bIsNoIntGrid) if (false == bIsNoIntGrid)
...@@ -1858,10 +1894,10 @@ CGraphics.prototype = ...@@ -1858,10 +1894,10 @@ CGraphics.prototype =
} }
} }
this.DrawStringASCII("Courier New", 9, false, false, _header_text, 2, yPos, true); this.DrawStringASCII("Courier New", AscBrowser.isRetina ? 18 : 9, false, false, _header_text, 2, yPos, true);
if (bIsRepeat) if (bIsRepeat)
this.DrawStringASCII2("Courier New", 9, false, false, "Same as Previous", 2, yPos, true); this.DrawStringASCII2("Courier New", AscBrowser.isRetina ? 18 : 9, false, false, "Same as Previous", 2, yPos, true);
if (false == bIsNoIntGrid) if (false == bIsNoIntGrid)
this.SetIntegerGrid(false); this.SetIntegerGrid(false);
...@@ -1875,6 +1911,13 @@ CGraphics.prototype = ...@@ -1875,6 +1911,13 @@ CGraphics.prototype =
var _w1 = 6; var _w1 = 6;
var _w2 = 3; var _w2 = 3;
var _lineWidth = 1;
if (AscBrowser.isRetina)
{
_y >>= 0;
_lineWidth = 2;
}
var ctx = this.m_oContext; var ctx = this.m_oContext;
switch (lock_type) switch (lock_type)
...@@ -1886,14 +1929,14 @@ CGraphics.prototype = ...@@ -1886,14 +1929,14 @@ CGraphics.prototype =
//ctx.lineWidth = 2; //ctx.lineWidth = 2;
// GlobalSkin.RulerOutline // GlobalSkin.RulerOutline
this.p_color(0xBB, 0xBE, 0xC2, 255); this.p_color(0xBB, 0xBE, 0xC2, 255);
ctx.lineWidth = 1; ctx.lineWidth = _lineWidth;
break; break;
} }
case locktype_Other: case locktype_Other:
case locktype_Other2: case locktype_Other2:
{ {
this.p_color(238, 53, 37, 255); this.p_color(238, 53, 37, 255);
ctx.lineWidth = 1; ctx.lineWidth = _lineWidth;
_w1 = 2; _w1 = 2;
_w2 = 1; _w2 = 1;
break; break;
...@@ -1901,12 +1944,18 @@ CGraphics.prototype = ...@@ -1901,12 +1944,18 @@ CGraphics.prototype =
default: default:
{ {
this.p_color(155, 187, 277, 255); this.p_color(155, 187, 277, 255);
ctx.lineWidth = 2; ctx.lineWidth = _lineWidth;
_w1 = 2; _w1 = 2;
_w2 = 1; _w2 = 1;
} }
} }
if (AscBrowser.isRetina)
{
_w1 <<= 1;
_w2 <<= 1;
}
var _wmax = this.m_lWidthPix; var _wmax = this.m_lWidthPix;
var bIsNoIntGrid = this.m_bIntegerGrid; var bIsNoIntGrid = this.m_bIntegerGrid;
...@@ -1943,10 +1992,10 @@ CGraphics.prototype = ...@@ -1943,10 +1992,10 @@ CGraphics.prototype =
} }
} }
this.DrawStringASCII("Courier New", 9, false, false, _header_text, 2, yPos, false); this.DrawStringASCII("Courier New", AscBrowser.isRetina ? 18 : 9, false, false, _header_text, 2, yPos, false);
if (bIsRepeat) if (bIsRepeat)
this.DrawStringASCII2("Courier New", 9, false, false, "Same as Previous", 2, yPos, false); this.DrawStringASCII2("Courier New", AscBrowser.isRetina ? 18 : 9, false, false, "Same as Previous", 2, yPos, false);
if (false == bIsNoIntGrid) if (false == bIsNoIntGrid)
this.SetIntegerGrid(false); this.SetIntegerGrid(false);
......
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