Commit 45ce1c7c authored by Sergey Luzyanin's avatar Sergey Luzyanin Committed by Alexander.Trofimov

Печать спарклайнов

parent ef619df5
......@@ -755,36 +755,22 @@ CSparklineView.prototype.draw = function(graphics, offX, offY)
this.chartSpace.transform.ty = this.chartSpace.y;
}
}
//graphics.m_oCoordTransform.tx = x;
//graphics.m_oCoordTransform.ty = y;
/*var _l = this.chartSpace.chartObj.calcProp.chartGutter._left;
var _t = this.chartSpace.chartObj.calcProp.chartGutter._top;
var _r = this.chartSpace.chartObj.calcProp.chartGutter._right;
var _b = this.chartSpace.chartObj.calcProp.chartGutter._bottom;*/
var _true_height = this.chartSpace.chartObj.calcProp.chartGutter.trueHeight;
var _true_width = this.chartSpace.chartObj.calcProp.chartGutter.trueWidht;
var tx, ty, sx, sy, oldExtX, oldExtY;
var _true_height = this.chartSpace.chartObj.calcProp.chartGutter.trueHeight;
var _true_width = this.chartSpace.chartObj.calcProp.chartGutter.trueWidht;
this.chartSpace.chartObj.calcProp.trueWidht = this.chartSpace.extX * this.chartSpace.chartObj.calcProp.pxToMM;
this.chartSpace.chartObj.calcProp.trueHeight = this.chartSpace.extY * this.chartSpace.chartObj.calcProp.pxToMM;
/*this.chartSpace.chartObj.calcProp.chartGutter._left = 0;
this.chartSpace.chartObj.calcProp.chartGutter._top = 0;
this.chartSpace.chartObj.calcProp.chartGutter._right = 0;
this.chartSpace.chartObj.calcProp.chartGutter._bottom = 0;*/
this.chartSpace.draw(graphics);
/*this.chartSpace.chartObj.calcProp.chartGutter._left = _l;
this.chartSpace.chartObj.calcProp.chartGutter._top = _t;
this.chartSpace.chartObj.calcProp.chartGutter._right = _r;
this.chartSpace.chartObj.calcProp.chartGutter._bottom = _b;*/
this.chartSpace.chartObj.calcProp.trueWidht = _true_width;
this.chartSpace.chartObj.calcProp.trueHeight = _true_height;
};
......@@ -2536,7 +2522,7 @@ function DrawingObjects() {
var graphics, i, j;
if(oDrawingContext instanceof CPdfPrinter)
{
graphics = oDrawingContext;
graphics = oDrawingContext.DocumentRenderer;
}
else
{
......@@ -2565,10 +2551,33 @@ function DrawingObjects() {
if (!oSparklineGroup.arrSparklines[j].checkInRange(range)) {
continue;
}
if(oDrawingContext instanceof CPdfPrinter)
{
graphics.SaveGrState();
var _baseTransform = new CMatrix();
_baseTransform.sx /= nSparklineMultiplier;
_baseTransform.sy /= nSparklineMultiplier;
graphics.SetBaseTransform(_baseTransform);
}
oSparklineGroup.arrCachedSparklines[j].draw(graphics, _offX, _offY);
if(oDrawingContext instanceof CPdfPrinter)
{
graphics.SetBaseTransform(null);
graphics.RestoreGrState();
}
}
}
oDrawingContext.restore();
if(oDrawingContext instanceof CPdfPrinter)
{
}
else
{
oDrawingContext.restore();
}
};
_this.rebuildChartGraphicObjects = function(data)
......
......@@ -1490,10 +1490,16 @@ function CDocumentRenderer()
this.m_oTransform = null;
this._restoreDumpedVectors = null;
this.m_oBaseTransform = null;
}
CDocumentRenderer.prototype =
{
SetBaseTransform : function(_matrix)
{
this.m_oBaseTransform = _matrix;
},
BeginPage : function(width,height)
{
this.m_arrayPages[this.m_arrayPages.length] = new CMetafile(width,height);
......@@ -1543,7 +1549,22 @@ CDocumentRenderer.prototype =
transform : function(sx,shy,shx,sy,tx,ty)
{
if (0 != this.m_lPagesCount)
{
if (null == this.m_oBaseTransform)
this.m_arrayPages[this.m_lPagesCount - 1].transform(sx,shy,shx,sy,tx,ty);
else
{
var _transform = new CMatrix();
_transform.sx = sx;
_transform.shy = shy;
_transform.shx = shx;
_transform.sy = sy;
_transform.tx = tx;
_transform.ty = ty;
global_MatrixTransformer.MultiplyAppend(_transform, this.m_oBaseTransform);
this.m_arrayPages[this.m_lPagesCount - 1].transform(_transform.sx,_transform.shy,_transform.shx,_transform.sy,_transform.tx,_transform.ty);
}
}
},
transform3 : function(m)
{
......@@ -2106,7 +2127,10 @@ CDocumentRenderer.prototype =
},
RestoreGrState : function()
{
var _t = this.m_oBaseTransform;
this.m_oBaseTransform = null;
this.GrState.RestoreGrState();
this.m_oBaseTransform = _t;
},
StartClipPath : function()
......
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