Commit bd683b0e authored by Alexey.Musinov's avatar Alexey.Musinov

up

parent a10f0edb
......@@ -3926,7 +3926,32 @@ function OfflineEditor () {
if (chartData.length > 0) {
var json = JSON.parse(chartData);
if (json) {
var nativeToEditor = 1.0 / deviceScale * (72.0 / 96.0);
var screenWidth = this.initSettings["screenWidth"] * nativeToEditor / 2.54 - ws.headersWidth;
var screenHeight = this.initSettings["screenHeight"] * nativeToEditor / 2.54 - ws.headersHeight;
_api.asc_addChartDrawingObject(json);
var objects = ws.objectRender.controller.drawingObjects.getDrawingObjects();
if (objects.length > 0) {
var gr = objects[0].graphicObject;
var w = gr.spPr.xfrm.extX;
var h = gr.spPr.xfrm.extY;
var offX = Math.max(0, (screenWidth - w) * 0.5);
var offY = Math.max(screenHeight * 0.2, (screenHeight - w) * 0.5);
gr.spPr.xfrm.setOffX(offX);
gr.spPr.xfrm.setOffY(offY);
gr.checkDrawingBaseCoords();
gr.recalculate();
}
//console.log(JSON.stringify(json));
}
}
......
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