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,15 +564,37 @@ CGraphics.prototype =
this.m_oPen.LineWidth = w / 1000;
if (!this.m_bIntegerGrid)
this.m_oContext.lineWidth = this.m_oPen.LineWidth;
{
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
{
var _m = this.m_oFullTransform;
var x = _m.sx + _m.shx;
var y = _m.sy + _m.shy;
if (0 != this.m_oPen.LineWidth)
{
var _m = this.m_oFullTransform;
var x = _m.sx + _m.shx;
var y = _m.sy + _m.shy;
var koef = Math.sqrt((x * x + y * y) / 2);
this.m_oContext.lineWidth = this.m_oPen.LineWidth * koef;
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
......
......@@ -595,15 +595,37 @@ CGraphics.prototype =
this.m_oPen.LineWidth = w / 1000;
if (!this.m_bIntegerGrid)
this.m_oContext.lineWidth = this.m_oPen.LineWidth;
{
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
{
var _m = this.m_oFullTransform;
var x = _m.sx + _m.shx;
var y = _m.sy + _m.shy;
if (0 != this.m_oPen.LineWidth)
{
var _m = this.m_oFullTransform;
var x = _m.sx + _m.shx;
var y = _m.sy + _m.shy;
var koef = Math.sqrt((x * x + y * y) / 2);
this.m_oContext.lineWidth = this.m_oPen.LineWidth * koef;
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
......
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