Commit a0c34b44 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@56512 954022d7-b5bf-4e40-9824-e11837661b57
parent c23362da
......@@ -564,8 +564,25 @@ CGraphics.prototype =
this.m_oPen.LineWidth = w / 1000;
if (!this.m_bIntegerGrid)
{
if (0 != this.m_oPen.LineWidth)
{
this.m_oContext.lineWidth = this.m_oPen.LineWidth;
}
else
{
var _x1 = this.m_oFullTransform.TransformPointX(0, 0);
var _y1 = this.m_oFullTransform.TransformPointY(0, 0);
var _x2 = this.m_oFullTransform.TransformPointX(1, 1);
var _y2 = this.m_oFullTransform.TransformPointY(1, 1);
var _koef = Math.sqrt(((_x2 - _x1)*(_x2 - _x1) + (_y2 - _y1)*(_y2 - _y1)) / 2);
this.m_oContext.lineWidth = 1 / _koef;
}
}
else
{
if (0 != this.m_oPen.LineWidth)
{
var _m = this.m_oFullTransform;
var x = _m.sx + _m.shx;
......@@ -574,6 +591,11 @@ CGraphics.prototype =
var koef = Math.sqrt((x * x + y * y) / 2);
this.m_oContext.lineWidth = this.m_oPen.LineWidth * koef;
}
else
{
this.m_oContext.lineWidth = 1;
}
}
},
// brush methods
b_color1 : function(r,g,b,a)
......
......@@ -595,8 +595,25 @@ CGraphics.prototype =
this.m_oPen.LineWidth = w / 1000;
if (!this.m_bIntegerGrid)
{
if (0 != this.m_oPen.LineWidth)
{
this.m_oContext.lineWidth = this.m_oPen.LineWidth;
}
else
{
var _x1 = this.m_oFullTransform.TransformPointX(0, 0);
var _y1 = this.m_oFullTransform.TransformPointY(0, 0);
var _x2 = this.m_oFullTransform.TransformPointX(1, 1);
var _y2 = this.m_oFullTransform.TransformPointY(1, 1);
var _koef = Math.sqrt(((_x2 - _x1)*(_x2 - _x1) + (_y2 - _y1)*(_y2 - _y1)) / 2);
this.m_oContext.lineWidth = 1 / _koef;
}
}
else
{
if (0 != this.m_oPen.LineWidth)
{
var _m = this.m_oFullTransform;
var x = _m.sx + _m.shx;
......@@ -605,6 +622,11 @@ CGraphics.prototype =
var koef = Math.sqrt((x * x + y * y) / 2);
this.m_oContext.lineWidth = this.m_oPen.LineWidth * koef;
}
else
{
this.m_oContext.lineWidth = 1;
}
}
},
// brush methods
b_color1 : function(r,g,b,a)
......
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