Commit 6ca477aa authored by Sergey Luzyanin's avatar Sergey Luzyanin

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

parent 5dc4320a
...@@ -779,36 +779,22 @@ CSparklineView.prototype.draw = function(graphics, offX, offY) ...@@ -779,36 +779,22 @@ CSparklineView.prototype.draw = function(graphics, offX, offY)
this.chartSpace.transform.ty = this.chartSpace.y; this.chartSpace.transform.ty = this.chartSpace.y;
} }
} }
//graphics.m_oCoordTransform.tx = x;
//graphics.m_oCoordTransform.ty = y; var tx, ty, sx, sy, oldExtX, oldExtY;
/*var _l = this.chartSpace.chartObj.calcProp.chartGutter._left; var _true_height = this.chartSpace.chartObj.calcProp.chartGutter.trueHeight;
var _t = this.chartSpace.chartObj.calcProp.chartGutter._top; var _true_width = this.chartSpace.chartObj.calcProp.chartGutter.trueWidht;
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;
this.chartSpace.chartObj.calcProp.trueWidht = this.chartSpace.extX * this.chartSpace.chartObj.calcProp.pxToMM; 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.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.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.trueWidht = _true_width;
this.chartSpace.chartObj.calcProp.trueHeight = _true_height; this.chartSpace.chartObj.calcProp.trueHeight = _true_height;
}; };
...@@ -2560,7 +2546,7 @@ function DrawingObjects() { ...@@ -2560,7 +2546,7 @@ function DrawingObjects() {
var graphics, i, j; var graphics, i, j;
if(oDrawingContext instanceof CPdfPrinter) if(oDrawingContext instanceof CPdfPrinter)
{ {
graphics = oDrawingContext; graphics = oDrawingContext.DocumentRenderer;
} }
else else
{ {
...@@ -2589,10 +2575,33 @@ function DrawingObjects() { ...@@ -2589,10 +2575,33 @@ function DrawingObjects() {
if (!oSparklineGroup.arrSparklines[j].checkInRange(range)) { if (!oSparklineGroup.arrSparklines[j].checkInRange(range)) {
continue; 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); 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) _this.rebuildChartGraphicObjects = function(data)
......
/* /*
* *
* (c) Copyright Ascensio System Limited 2010-2016 * (c) Copyright Ascensio System Limited 2010-2016
* *
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU * This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html). * General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that * In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights. * Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
* *
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html * FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
* *
* You can contact Ascensio System SIA by email at sales@onlyoffice.com * You can contact Ascensio System SIA by email at sales@onlyoffice.com
* *
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display * The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3. * Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
* *
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains * Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic * relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE" * form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute. * in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks. * Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
* *
*/ */
"use strict"; "use strict";
function CGrRFonts() function CGrRFonts()
...@@ -1514,10 +1514,16 @@ function CDocumentRenderer() ...@@ -1514,10 +1514,16 @@ function CDocumentRenderer()
this.m_oTransform = null; this.m_oTransform = null;
this._restoreDumpedVectors = null; this._restoreDumpedVectors = null;
this.m_oBaseTransform = null;
} }
CDocumentRenderer.prototype = CDocumentRenderer.prototype =
{ {
SetBaseTransform : function(_matrix)
{
this.m_oBaseTransform = _matrix;
},
BeginPage : function(width,height) BeginPage : function(width,height)
{ {
this.m_arrayPages[this.m_arrayPages.length] = new CMetafile(width,height); this.m_arrayPages[this.m_arrayPages.length] = new CMetafile(width,height);
...@@ -1567,7 +1573,22 @@ CDocumentRenderer.prototype = ...@@ -1567,7 +1573,22 @@ CDocumentRenderer.prototype =
transform : function(sx,shy,shx,sy,tx,ty) transform : function(sx,shy,shx,sy,tx,ty)
{ {
if (0 != this.m_lPagesCount) if (0 != this.m_lPagesCount)
this.m_arrayPages[this.m_lPagesCount - 1].transform(sx,shy,shx,sy,tx,ty); {
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) transform3 : function(m)
{ {
...@@ -2130,7 +2151,10 @@ CDocumentRenderer.prototype = ...@@ -2130,7 +2151,10 @@ CDocumentRenderer.prototype =
}, },
RestoreGrState : function() RestoreGrState : function()
{ {
var _t = this.m_oBaseTransform;
this.m_oBaseTransform = null;
this.GrState.RestoreGrState(); this.GrState.RestoreGrState();
this.m_oBaseTransform = _t;
}, },
StartClipPath : function() 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