Commit 7047d461 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

AddSmartRect in Graphics

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57901 954022d7-b5bf-4e40-9824-e11837661b57
parent f5faa964
......@@ -2496,6 +2496,55 @@ CGraphics.prototype =
//this.ClipManager.RemoveRect();
},
AddSmartRect : function(x, y, w, h, pen_w)
{
if (!global_MatrixTransformer.IsIdentity2(this.m_oTransform))
{
this.ds();
return;
}
var bIsSmartAttack = false;
if (!this.m_bIntegerGrid)
{
this.SetIntegerGrid(true);
bIsSmartAttack = true;
}
var _pen_w = (pen_w * this.m_oCoordTransform.sx + 0.5) >> 0;
if (0 >= _pen_w)
_pen_w = 1;
this._s();
if ((_pen_w & 0x01) == 0x01)
{
var _x = (this.m_oFullTransform.TransformPointX(x, y) >> 0) + 0.5;
var _y = (this.m_oFullTransform.TransformPointY(x, y) >> 0) + 0.5;
var _r = (this.m_oFullTransform.TransformPointX(x+w, y+h) >> 0) + 0.5;
var _b = (this.m_oFullTransform.TransformPointY(x+w, y+h) >> 0) + 0.5;
this.m_oContext.rect(_x, _y, _r - _x, _b - _y);
}
else
{
var _x = (this.m_oFullTransform.TransformPointX(x, y) + 0.5) >> 0;
var _y = (this.m_oFullTransform.TransformPointY(x, y) + 0.5) >> 0;
var _r = (this.m_oFullTransform.TransformPointX(x+w, y+h) + 0.5) >> 0;
var _b = (this.m_oFullTransform.TransformPointY(x+w, y+h) + 0.5) >> 0;
this.m_oContext.rect(_x, _y, _r - _x, _b - _y);
}
this.m_oContext.lineWidth = _pen_w;
this.ds();
if (bIsSmartAttack)
{
this.SetIntegerGrid(false);
}
},
SetClip : function(r)
{
var ctx = this.m_oContext;
......
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