Commit ae4af0bb authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/Drawings/TrackObjects/ResizeTracks to function-closure

common/Drawings/TrackObjects/RotateTracks to function-closure
common/Drawings/TrackObjects/Spline to function-closure
parent 16b82922
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
"../common/Drawings/TrackObjects/MoveTracks.js", "../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js", "../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js", "../common/Drawings/TrackObjects/PolyLine.js",
"../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/Spline.js",
"../common/scroll.js", "../common/scroll.js",
"../cell/view/iscroll.js", "../cell/view/iscroll.js",
...@@ -98,9 +101,6 @@ ...@@ -98,9 +101,6 @@
"../common/SerializeCommonWordExcel.js", "../common/SerializeCommonWordExcel.js",
"../common/SerializeChart.js", "../common/SerializeChart.js",
"../common/Drawings/DrawingObjectsHandlers.js", "../common/Drawings/DrawingObjectsHandlers.js",
"../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/Spline.js",
"../common/Drawings/TextDrawer.js", "../common/Drawings/TextDrawer.js",
"../cell/view/DrawingObjectsController.js", "../cell/view/DrawingObjectsController.js",
"../cell/model/DrawingObjects/Graphics.js", "../cell/model/DrawingObjects/Graphics.js",
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
"../common/Drawings/TrackObjects/MoveTracks.js", "../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js", "../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js", "../common/Drawings/TrackObjects/PolyLine.js",
"../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/Spline.js",
"../common/scroll.js", "../common/scroll.js",
...@@ -73,9 +76,6 @@ ...@@ -73,9 +76,6 @@
"../word/Editor/Sections.js", "../word/Editor/Sections.js",
"../word/Editor/History.js", "../word/Editor/History.js",
"../common/Drawings/DrawingObjectsHandlers.js", "../common/Drawings/DrawingObjectsHandlers.js",
"../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/Spline.js",
"../word/Drawing/HatchPattern.js", "../word/Drawing/HatchPattern.js",
"../word/Drawing/Graphics.js", "../word/Drawing/Graphics.js",
"../common/Overlay.js", "../common/Overlay.js",
......
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
"../common/Drawings/TrackObjects/MoveTracks.js", "../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/TrackObjects/NewShapeTracks.js", "../common/Drawings/TrackObjects/NewShapeTracks.js",
"../common/Drawings/TrackObjects/PolyLine.js", "../common/Drawings/TrackObjects/PolyLine.js",
"../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/Spline.js",
"../common/scroll.js", "../common/scroll.js",
"../common/Scrolls/iscroll.js", "../common/Scrolls/iscroll.js",
...@@ -60,9 +63,6 @@ ...@@ -60,9 +63,6 @@
"../word/Drawing/Externals.js", "../word/Drawing/Externals.js",
"../common/GlobalLoaders.js", "../common/GlobalLoaders.js",
"../word/Drawing/translations.js", "../word/Drawing/translations.js",
"../common/Drawings/TrackObjects/ResizeTracks.js",
"../common/Drawings/TrackObjects/RotateTracks.js",
"../common/Drawings/TrackObjects/Spline.js",
"../common/Drawings/DrawingObjectsHandlers.js", "../common/Drawings/DrawingObjectsHandlers.js",
"../common/Drawings/Joined.js", "../common/Drawings/Joined.js",
"../common/Drawings/TextDrawer.js", "../common/Drawings/TextDrawer.js",
......
...@@ -648,7 +648,7 @@ function CLineStructure(oLine) ...@@ -648,7 +648,7 @@ function CLineStructure(oLine)
{ {
this.m_nType = DRAW_COMMAND_LINE; this.m_nType = DRAW_COMMAND_LINE;
this.m_oLine = oLine; this.m_oLine = oLine;
this.m_aContent = [];//ObjectToDraw this.m_aContent = [];//AscFormat.ObjectToDraw
this.m_aBorders = []; this.m_aBorders = [];
this.m_aBackgrounds = []; this.m_aBackgrounds = [];
this.m_aUnderlinesStrikeouts = []; this.m_aUnderlinesStrikeouts = [];
...@@ -1221,7 +1221,7 @@ CTextDrawer.prototype = ...@@ -1221,7 +1221,7 @@ CTextDrawer.prototype =
{ {
if(oLastCommand.m_aContent.length === 0) if(oLastCommand.m_aContent.length === 0)
{ {
oLastCommand.m_aContent.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y, this.m_oCurComment)); oLastCommand.m_aContent.push(new AscFormat.ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y, this.m_oCurComment));
} }
oLastObjectToDraw = oLastCommand.m_aContent[oLastCommand.m_aContent.length - 1]; oLastObjectToDraw = oLastCommand.m_aContent[oLastCommand.m_aContent.length - 1];
...@@ -1233,7 +1233,7 @@ CTextDrawer.prototype = ...@@ -1233,7 +1233,7 @@ CTextDrawer.prototype =
} }
else else
{ {
oLastCommand.m_aContent.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)); oLastCommand.m_aContent.push(new AscFormat.ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y));
oLastObjectToDraw = oLastCommand.m_aContent[oLastCommand.m_aContent.length - 1]; oLastObjectToDraw = oLastCommand.m_aContent[oLastCommand.m_aContent.length - 1];
} }
} }
...@@ -1243,7 +1243,7 @@ CTextDrawer.prototype = ...@@ -1243,7 +1243,7 @@ CTextDrawer.prototype =
{ {
if(oLastCommand.m_aBorders.length === 0) if(oLastCommand.m_aBorders.length === 0)
{ {
oLastCommand.m_aBorders.push(new ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)) oLastCommand.m_aBorders.push(new AscFormat.ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y))
} }
oLastObjectToDraw = oLastCommand.m_aBorders[oLastCommand.m_aBorders.length - 1]; oLastObjectToDraw = oLastCommand.m_aBorders[oLastCommand.m_aBorders.length - 1];
...@@ -1255,7 +1255,7 @@ CTextDrawer.prototype = ...@@ -1255,7 +1255,7 @@ CTextDrawer.prototype =
} }
else else
{ {
oLastCommand.m_aBorders.push(new ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)); oLastCommand.m_aBorders.push(new AscFormat.ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y));
oLastObjectToDraw = oLastCommand.m_aBorders[oLastCommand.m_aBorders.length - 1]; oLastObjectToDraw = oLastCommand.m_aBorders[oLastCommand.m_aBorders.length - 1];
} }
} }
...@@ -1265,7 +1265,7 @@ CTextDrawer.prototype = ...@@ -1265,7 +1265,7 @@ CTextDrawer.prototype =
{ {
if(oLastCommand.m_aBackgrounds.length === 0) if(oLastCommand.m_aBackgrounds.length === 0)
{ {
oLastCommand.m_aBackgrounds.push(new ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)) oLastCommand.m_aBackgrounds.push(new AscFormat.ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y))
} }
oLastObjectToDraw = oLastCommand.m_aBackgrounds[oLastCommand.m_aBackgrounds.length - 1]; oLastObjectToDraw = oLastCommand.m_aBackgrounds[oLastCommand.m_aBackgrounds.length - 1];
...@@ -1277,7 +1277,7 @@ CTextDrawer.prototype = ...@@ -1277,7 +1277,7 @@ CTextDrawer.prototype =
} }
else else
{ {
oLastCommand.m_aBackgrounds.push(new ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)); oLastCommand.m_aBackgrounds.push(new AscFormat.ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y));
oLastObjectToDraw = oLastCommand.m_aBackgrounds[oLastCommand.m_aBackgrounds.length - 1]; oLastObjectToDraw = oLastCommand.m_aBackgrounds[oLastCommand.m_aBackgrounds.length - 1];
} }
} }
...@@ -1289,7 +1289,7 @@ CTextDrawer.prototype = ...@@ -1289,7 +1289,7 @@ CTextDrawer.prototype =
{ {
oBrushColor = this.m_oBrush.Color1; oBrushColor = this.m_oBrush.Color1;
oPenColor = this.m_oPen.Color; oPenColor = this.m_oPen.Color;
oLastCommand.m_aUnderlinesStrikeouts.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)) oLastCommand.m_aUnderlinesStrikeouts.push(new AscFormat.ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y))
} }
oLastObjectToDraw = oLastCommand.m_aUnderlinesStrikeouts[oLastCommand.m_aUnderlinesStrikeouts.length - 1]; oLastObjectToDraw = oLastCommand.m_aUnderlinesStrikeouts[oLastCommand.m_aUnderlinesStrikeouts.length - 1];
...@@ -1301,7 +1301,7 @@ CTextDrawer.prototype = ...@@ -1301,7 +1301,7 @@ CTextDrawer.prototype =
} }
else else
{ {
oLastCommand.m_aUnderlinesStrikeouts.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)); oLastCommand.m_aUnderlinesStrikeouts.push(new AscFormat.ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y));
oLastObjectToDraw = oLastCommand.m_aUnderlinesStrikeouts[oLastCommand.m_aUnderlinesStrikeouts.length - 1]; oLastObjectToDraw = oLastCommand.m_aUnderlinesStrikeouts[oLastCommand.m_aUnderlinesStrikeouts.length - 1];
} }
} }
...@@ -1311,7 +1311,7 @@ CTextDrawer.prototype = ...@@ -1311,7 +1311,7 @@ CTextDrawer.prototype =
{ {
if(oLastCommand.m_aParagraphBackgrounds.length === 0) if(oLastCommand.m_aParagraphBackgrounds.length === 0)
{ {
oLastCommand.m_aParagraphBackgrounds.push(new ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)) oLastCommand.m_aParagraphBackgrounds.push(new AscFormat.ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y))
} }
oLastObjectToDraw = oLastCommand.m_aParagraphBackgrounds[oLastCommand.m_aParagraphBackgrounds.length - 1]; oLastObjectToDraw = oLastCommand.m_aParagraphBackgrounds[oLastCommand.m_aParagraphBackgrounds.length - 1];
...@@ -1323,7 +1323,7 @@ CTextDrawer.prototype = ...@@ -1323,7 +1323,7 @@ CTextDrawer.prototype =
} }
else else
{ {
oLastCommand.m_aParagraphBackgrounds.push(new ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)); oLastCommand.m_aParagraphBackgrounds.push(new AscFormat.ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y));
oLastObjectToDraw = oLastCommand.m_aParagraphBackgrounds[oLastCommand.m_aParagraphBackgrounds.length - 1]; oLastObjectToDraw = oLastCommand.m_aParagraphBackgrounds[oLastCommand.m_aParagraphBackgrounds.length - 1];
} }
} }
...@@ -1338,7 +1338,7 @@ CTextDrawer.prototype = ...@@ -1338,7 +1338,7 @@ CTextDrawer.prototype =
{ {
oBrushColor = this.m_oBrush.Color1; oBrushColor = this.m_oBrush.Color1;
oPenColor = this.m_oPen.Color; oPenColor = this.m_oPen.Color;
oLastCommand.m_aBorders.push(new ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)); oLastCommand.m_aBorders.push(new AscFormat.ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y));
} }
oLastObjectToDraw = oLastCommand.m_aBorders[oLastCommand.m_aBorders.length - 1]; oLastObjectToDraw = oLastCommand.m_aBorders[oLastCommand.m_aBorders.length - 1];
...@@ -1350,7 +1350,7 @@ CTextDrawer.prototype = ...@@ -1350,7 +1350,7 @@ CTextDrawer.prototype =
} }
else else
{ {
oLastCommand.m_aBorders.push(new ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y)); oLastCommand.m_aBorders.push(new AscFormat.ObjectToDraw(this.m_oFill, this.m_oLine, this.Width, this.Height, new AscFormat.Geometry(), this.m_oTransform, x, y));
oLastObjectToDraw = oLastCommand.m_aBorders[oLastCommand.m_aBorders.length - 1]; oLastObjectToDraw = oLastCommand.m_aBorders[oLastCommand.m_aBorders.length - 1];
} }
} }
......
...@@ -1669,7 +1669,7 @@ CGroupShape.prototype = ...@@ -1669,7 +1669,7 @@ CGroupShape.prototype =
createRotateTrack: function() createRotateTrack: function()
{ {
return new RotateTrackGroup(this); return new AscFormat.RotateTrackGroup(this);
}, },
createMoveTrack: function() createMoveTrack: function()
...@@ -1678,7 +1678,7 @@ CGroupShape.prototype = ...@@ -1678,7 +1678,7 @@ CGroupShape.prototype =
}, },
createResizeTrack: function(cardDirection) createResizeTrack: function(cardDirection)
{ {
return new ResizeTrackGroup(this, cardDirection); return new AscFormat.ResizeTrackGroup(this, cardDirection);
}, },
resetSelection: function(graphicObjects) resetSelection: function(graphicObjects)
......
...@@ -317,12 +317,12 @@ CImageShape.prototype = ...@@ -317,12 +317,12 @@ CImageShape.prototype =
createRotateTrack: function() createRotateTrack: function()
{ {
return new RotateTrackShapeImage(this); return new AscFormat.RotateTrackShapeImage(this);
}, },
createResizeTrack: function(cardDirection) createResizeTrack: function(cardDirection)
{ {
return new ResizeTrackShapeImage(this, cardDirection); return new AscFormat.ResizeTrackShapeImage(this, cardDirection);
}, },
createMoveTrack: function() createMoveTrack: function()
......
...@@ -4893,11 +4893,11 @@ CShape.prototype = ...@@ -4893,11 +4893,11 @@ CShape.prototype =
}, },
createRotateTrack: function () { createRotateTrack: function () {
return new RotateTrackShapeImage(this); return new AscFormat.RotateTrackShapeImage(this);
}, },
createResizeTrack: function (cardDirection) { createResizeTrack: function (cardDirection) {
return new ResizeTrackShapeImage(this, cardDirection); return new AscFormat.ResizeTrackShapeImage(this, cardDirection);
}, },
createMoveTrack: function () { createMoveTrack: function () {
......
...@@ -96,17 +96,17 @@ StartAddNewShape.prototype = ...@@ -96,17 +96,17 @@ StartAddNewShape.prototype =
if(!this.bMoved && this instanceof StartAddNewShape) if(!this.bMoved && this instanceof StartAddNewShape)
{ {
var ext_x, ext_y; var ext_x, ext_y;
if(typeof SHAPE_EXT[this.preset] === "number") if(typeof AscFormat.SHAPE_EXT[this.preset] === "number")
{ {
ext_x = SHAPE_EXT[this.preset]; ext_x = AscFormat.SHAPE_EXT[this.preset];
} }
else else
{ {
ext_x = 25.4; ext_x = 25.4;
} }
if(typeof SHAPE_ASPECTS[this.preset] === "number") if(typeof AscFormat.SHAPE_ASPECTS[this.preset] === "number")
{ {
var _aspect = SHAPE_ASPECTS[this.preset]; var _aspect = AscFormat.SHAPE_ASPECTS[this.preset];
ext_y = ext_x/_aspect; ext_y = ext_x/_aspect;
} }
else else
...@@ -1335,8 +1335,8 @@ SplineBezierState.prototype = ...@@ -1335,8 +1335,8 @@ SplineBezierState.prototype =
return {objectId: "1", bMarker: true}; return {objectId: "1", bMarker: true};
this.drawingObjects.startTrackPos = {x: x, y: y, pageIndex: pageIndex}; this.drawingObjects.startTrackPos = {x: x, y: y, pageIndex: pageIndex};
this.drawingObjects.clearTrackObjects(); this.drawingObjects.clearTrackObjects();
this.drawingObjects.addTrackObject(new Spline(this.drawingObjects, this.drawingObjects.getTheme(), null, null, null, pageIndex)); this.drawingObjects.addTrackObject(new AscFormat.Spline(this.drawingObjects, this.drawingObjects.getTheme(), null, null, null, pageIndex));
this.drawingObjects.arrTrackObjects[0].path.push(new SplineCommandMoveTo(x, y)); this.drawingObjects.arrTrackObjects[0].path.push(new AscFormat.SplineCommandMoveTo(x, y));
this.drawingObjects.changeCurrentState(new SplineBezierState33(this.drawingObjects, x, y,pageIndex)); this.drawingObjects.changeCurrentState(new SplineBezierState33(this.drawingObjects, x, y,pageIndex));
this.drawingObjects.checkChartTextSelection(); this.drawingObjects.checkChartTextSelection();
this.drawingObjects.resetSelection(); this.drawingObjects.resetSelection();
...@@ -1398,7 +1398,7 @@ SplineBezierState33.prototype = ...@@ -1398,7 +1398,7 @@ SplineBezierState33.prototype =
tr_x = tr_point.X; tr_x = tr_point.X;
tr_y = tr_point.Y; tr_y = tr_point.Y;
} }
this.drawingObjects.arrTrackObjects[0].path.push(new SplineCommandLineTo(tr_x, tr_y)); this.drawingObjects.arrTrackObjects[0].path.push(new AscFormat.SplineCommandLineTo(tr_x, tr_y));
this.drawingObjects.changeCurrentState(new SplineBezierState2(this.drawingObjects, this.pageIndex)); this.drawingObjects.changeCurrentState(new SplineBezierState2(this.drawingObjects, this.pageIndex));
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
}, },
...@@ -1550,10 +1550,10 @@ SplineBezierState3.prototype = ...@@ -1550,10 +1550,10 @@ SplineBezierState3.prototype =
spline.path.length = 1; spline.path.length = 1;
spline.path.push(new SplineCommandBezier(x1, y1, x2, y2, x3, y3)); spline.path.push(new AscFormat.SplineCommandBezier(x1, y1, x2, y2, x3, y3));
spline.path.push(new SplineCommandBezier(x4, y4, x5, y5, x6, y6)); spline.path.push(new AscFormat.SplineCommandBezier(x4, y4, x5, y5, x6, y6));
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects, this.pageIndex)); this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects, this.pageIndex));
}, },
...@@ -1788,7 +1788,7 @@ SplineBezierState5.prototype = ...@@ -1788,7 +1788,7 @@ SplineBezierState5.prototype =
lastCommand.y2 = y2; lastCommand.y2 = y2;
spline.path.push(new SplineCommandBezier(x4, y4, x5, y5, x6, y6)); spline.path.push(new AscFormat.SplineCommandBezier(x4, y4, x5, y5, x6, y6));
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects, this.pageIndex)); this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects, this.pageIndex));
}, },
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
// Import // Import
var Geometry = AscFormat.Geometry; var Geometry = AscFormat.Geometry;
var EPSILON_TEXT_AUTOFIT = AscFormat.EPSILON_TEXT_AUTOFIT; var EPSILON_TEXT_AUTOFIT = AscFormat.EPSILON_TEXT_AUTOFIT;
var ObjectToDraw = AscFormat.ObjectToDraw;
var PATH_DIV_EPSILON = 0.1; var PATH_DIV_EPSILON = 0.1;
var UNDERLINE_DIV_EPSILON = 3; var UNDERLINE_DIV_EPSILON = 3;
......
...@@ -129,7 +129,7 @@ function XYAdjustmentTrack(originalShape, adjIndex, bTextWarp) ...@@ -129,7 +129,7 @@ function XYAdjustmentTrack(originalShape, adjIndex, bTextWarp)
this.refY = _ref_y; this.refY = _ref_y;
} }
} }
this.overlayObject = new OverlayObject(this.geometry, this.shapeWidth, this.shapeHeight, oBrush, oPen, this.transform); this.overlayObject = new AscFormat.OverlayObject(this.geometry, this.shapeWidth, this.shapeHeight, oBrush, oPen, this.transform);
}, this, []); }, this, []);
...@@ -370,7 +370,7 @@ function PolarAdjustmentTrack(originalShape, adjIndex, bTextWarp) ...@@ -370,7 +370,7 @@ function PolarAdjustmentTrack(originalShape, adjIndex, bTextWarp)
} }
this.overlayObject = new OverlayObject(this.geometry, this.shapeWidth, this.shapeHeight, oBrush, oPen, this.transform); this.overlayObject = new AscFormat.OverlayObject(this.geometry, this.shapeWidth, this.shapeHeight, oBrush, oPen, this.transform);
}, this, []); }, this, []);
......
...@@ -42,11 +42,11 @@ function MoveShapeImageTrack(originalObject) ...@@ -42,11 +42,11 @@ function MoveShapeImageTrack(originalObject)
} }
else else
{ {
var pen_brush = CreatePenBrushForChartTrack(); var pen_brush = AscFormat.CreatePenBrushForChartTrack();
this.brush = pen_brush.brush; this.brush = pen_brush.brush;
this.pen = pen_brush.pen; this.pen = pen_brush.pen;
} }
this.overlayObject = new OverlayObject(!(this.originalObject.getObjectType() === AscDFH.historyitem_type_ChartSpace)&& this.originalObject.spPr && this.originalObject.spPr.geometry, this.originalObject.extX, this.originalObject.extY, this.brush, this.pen, this.transform); this.overlayObject = new AscFormat.OverlayObject(!(this.originalObject.getObjectType() === AscDFH.historyitem_type_ChartSpace)&& this.originalObject.spPr && this.originalObject.spPr.geometry, this.originalObject.extX, this.originalObject.extY, this.brush, this.pen, this.transform);
this.groupInvertMatrix = null; this.groupInvertMatrix = null;
if(this.originalObject.group) if(this.originalObject.group)
...@@ -188,11 +188,11 @@ function MoveShapeImageTrackInGroup(originalObject) ...@@ -188,11 +188,11 @@ function MoveShapeImageTrackInGroup(originalObject)
} }
else else
{ {
var pen_brush = CreatePenBrushForChartTrack(); var pen_brush = AscFormat.CreatePenBrushForChartTrack();
this.brush = pen_brush.brush; this.brush = pen_brush.brush;
this.pen = pen_brush.pen; this.pen = pen_brush.pen;
} }
this.overlayObject = new OverlayObject(!(this.originalObject.getObjectType() === AscDFH.historyitem_type_ChartSpace)&& this.originalObject.spPr && this.originalObject.spPr.geometry, this.originalObject.extX, this.originalObject.extY, this.brush, this.pen, this.transform); this.overlayObject = new AscFormat.OverlayObject(!(this.originalObject.getObjectType() === AscDFH.historyitem_type_ChartSpace)&& this.originalObject.spPr && this.originalObject.spPr.geometry, this.originalObject.extX, this.originalObject.extY, this.brush, this.pen, this.transform);
this.inv = global_MatrixTransformer.Invert(originalObject.group.transform); this.inv = global_MatrixTransformer.Invert(originalObject.group.transform);
this.inv.tx = 0; this.inv.tx = 0;
this.inv.ty = 0; this.inv.ty = 0;
...@@ -267,7 +267,7 @@ function MoveGroupTrack(originalObject) ...@@ -267,7 +267,7 @@ function MoveGroupTrack(originalObject)
var gr_obj_transform_copy = arr_graphic_objects[i].transform.CreateDublicate(); var gr_obj_transform_copy = arr_graphic_objects[i].transform.CreateDublicate();
global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform); global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform);
this.arrTransforms2[i] = gr_obj_transform_copy; this.arrTransforms2[i] = gr_obj_transform_copy;
this.overlayObjects[i] = new OverlayObject(!( arr_graphic_objects[i].getObjectType() === AscDFH.historyitem_type_ChartSpace)&& arr_graphic_objects[i].spPr.geometry, arr_graphic_objects[i].extX, arr_graphic_objects[i].extY, this.overlayObjects[i] = new AscFormat.OverlayObject(!( arr_graphic_objects[i].getObjectType() === AscDFH.historyitem_type_ChartSpace)&& arr_graphic_objects[i].spPr.geometry, arr_graphic_objects[i].extX, arr_graphic_objects[i].extY,
arr_graphic_objects[i].brush, arr_graphic_objects[i].pen, new CMatrix()); arr_graphic_objects[i].brush, arr_graphic_objects[i].pen, new CMatrix());
} }
......
...@@ -26,6 +26,80 @@ ...@@ -26,6 +26,80 @@
(function(window, undefined){ (function(window, undefined){
var MIN_SHAPE_SIZE = 1.27;//размер меньше которого нельзя уменшить автофигуру или картинку по горизонтали или вертикали
var MIN_SHAPE_SIZE_DIV2 = MIN_SHAPE_SIZE/2.0;
var SHAPE_ASPECTS = {};
SHAPE_ASPECTS["can"] = 3616635/4810125;
SHAPE_ASPECTS["moon"] = 457200/914400;
SHAPE_ASPECTS["leftBracket"] = 73152/914400;
SHAPE_ASPECTS["rightBracket"] = 73152/914400;
SHAPE_ASPECTS["leftBrace"] = 155448/914400;
SHAPE_ASPECTS["rightBrace"] = 155448/914400;
SHAPE_ASPECTS["triangle"] = 1060704/914400;
SHAPE_ASPECTS["parallelogram"] = 1216152/914400;
SHAPE_ASPECTS["trapezoid"] = 914400/1216152;
SHAPE_ASPECTS["pentagon"] = 960120/914400;
SHAPE_ASPECTS["hexagon"] = 1060704/914400;
SHAPE_ASPECTS["bracePair"] = 1069848/914400;
SHAPE_ASPECTS["rightArrow"] = 978408/484632;
SHAPE_ASPECTS["leftArrow"] = 978408/484632;
SHAPE_ASPECTS["upArrow"] = 484632/978408;
SHAPE_ASPECTS["downArrow"] = 484632/978408;
SHAPE_ASPECTS["leftRightArrow"] = 1216152/484632;
SHAPE_ASPECTS["upDownArrow"] = 484632/1216152;
SHAPE_ASPECTS["bentArrow"] = 813816/868680;
SHAPE_ASPECTS["uturnArrow"] = 886968/877824;
SHAPE_ASPECTS["bentUpArrow"] = 850392/731520;
SHAPE_ASPECTS["curvedRightArrow"] = 731520/1216152;
SHAPE_ASPECTS["curvedLeftArrow"] = 731520/1216152;
SHAPE_ASPECTS["curvedUpArrow"] = 1216152/731520;
SHAPE_ASPECTS["curvedDownArrow"] = 1216152/731520;
SHAPE_ASPECTS["stripedRightArrow"] = 978408/484632;
SHAPE_ASPECTS["notchedRightArrow"] = 978408/484632;
SHAPE_ASPECTS["homePlate"] = 978408/484632;
SHAPE_ASPECTS["leftRightArrowCallout"] = 1216152/576072;
SHAPE_ASPECTS["flowChartProcess"] = 914400/612648;
SHAPE_ASPECTS["flowChartAlternateProcess"] = 914400/612648;
SHAPE_ASPECTS["flowChartDecision"] = 914400/612648;
SHAPE_ASPECTS["flowChartInputOutput"] = 914400/612648;
SHAPE_ASPECTS["flowChartPredefinedProcess"] = 914400/612648;
SHAPE_ASPECTS["flowChartDocument"] = 914400/612648;
SHAPE_ASPECTS["flowChartMultidocument"] = 1060704/758952;
SHAPE_ASPECTS["flowChartTerminator"] = 914400/301752;
SHAPE_ASPECTS["flowChartPreparation"] = 1060704/612648;
SHAPE_ASPECTS["flowChartManualInput"] = 914400/457200;
SHAPE_ASPECTS["flowChartManualOperation"] = 914400/612648;
SHAPE_ASPECTS["flowChartPunchedCard"] = 914400/804672;
SHAPE_ASPECTS["flowChartPunchedTape"] = 914400/804672;
SHAPE_ASPECTS["flowChartPunchedTape"] = 457200/914400;
SHAPE_ASPECTS["flowChartSort"] = 457200/914400;
SHAPE_ASPECTS["flowChartOnlineStorage"] = 914400/612648;
SHAPE_ASPECTS["flowChartMagneticDisk"] = 914400/612648;
SHAPE_ASPECTS["flowChartMagneticDrum"] = 914400/685800;
SHAPE_ASPECTS["flowChartDisplay"] = 914400/612648;
SHAPE_ASPECTS["ribbon2"] = 1216152/612648;
SHAPE_ASPECTS["ribbon"] = 1216152/612648;
SHAPE_ASPECTS["ellipseRibbon2"] = 1216152/758952;
SHAPE_ASPECTS["ellipseRibbon"] = 1216152/758952;
SHAPE_ASPECTS["verticalScroll"] = 1033272/1143000;
SHAPE_ASPECTS["horizontalScroll"] = 1143000/1033272;
SHAPE_ASPECTS["wedgeRectCallout"] = 914400/612648;
SHAPE_ASPECTS["wedgeRoundRectCallout"] = 914400/612648;
SHAPE_ASPECTS["wedgeEllipseCallout"] = 914400/612648;
SHAPE_ASPECTS["cloudCallout"] = 914400/612648;
SHAPE_ASPECTS["borderCallout1"] = 914400/612648;
SHAPE_ASPECTS["borderCallout2"] = 914400/612648;
SHAPE_ASPECTS["borderCallout3"] = 914400/612648;
SHAPE_ASPECTS["accentCallout1"] = 914400/612648;
SHAPE_ASPECTS["accentCallout2"] = 914400/612648;
SHAPE_ASPECTS["accentCallout3"] = 914400/612648;
SHAPE_ASPECTS["callout1"] = 914400/612648;
SHAPE_ASPECTS["callout2"] = 914400/612648;
SHAPE_ASPECTS["callout3"] = 914400/612648;
SHAPE_ASPECTS["accentBorderCallout1"] = 914400/612648;
SHAPE_ASPECTS["accentBorderCallout2"] = 914400/612648;
SHAPE_ASPECTS["accentBorderCallout3"] = 914400/612648;
function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, pageIndex) function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, pageIndex)
{ {
...@@ -149,7 +223,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, ...@@ -149,7 +223,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
this.isLine = this.presetGeom === "line"; this.isLine = this.presetGeom === "line";
this.overlayObject = new OverlayObject(geometry, 5, 5, brush, pen, this.transform); this.overlayObject = new AscFormat.OverlayObject(geometry, 5, 5, brush, pen, this.transform);
this.shape = null; this.shape = null;
}, this, []); }, this, []);
...@@ -223,7 +297,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, ...@@ -223,7 +297,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
{ {
var new_width, new_height; var new_width, new_height;
var prop_coefficient = (typeof SHAPE_ASPECTS[this.presetGeom] === "number" ? SHAPE_ASPECTS[this.presetGeom] : 1); var prop_coefficient = (typeof AscFormat.SHAPE_ASPECTS[this.presetGeom] === "number" ? AscFormat.SHAPE_ASPECTS[this.presetGeom] : 1);
if(abs_dist_y === 0) if(abs_dist_y === 0)
{ {
new_width = abs_dist_x > MIN_SHAPE_SIZE ? abs_dist_x : MIN_SHAPE_SIZE; new_width = abs_dist_x > MIN_SHAPE_SIZE ? abs_dist_x : MIN_SHAPE_SIZE;
...@@ -304,7 +378,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, ...@@ -304,7 +378,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
else else
{ {
var new_width, new_height; var new_width, new_height;
var prop_coefficient = (typeof SHAPE_ASPECTS[this.presetGeom] === "number" ? SHAPE_ASPECTS[this.presetGeom] : 1); var prop_coefficient = (typeof AscFormat.SHAPE_ASPECTS[this.presetGeom] === "number" ? AscFormat.SHAPE_ASPECTS[this.presetGeom] : 1);
if(abs_dist_y === 0) if(abs_dist_y === 0)
{ {
new_width = abs_dist_x > MIN_SHAPE_SIZE_DIV2 ? abs_dist_x*2 : MIN_SHAPE_SIZE; new_width = abs_dist_x > MIN_SHAPE_SIZE_DIV2 ? abs_dist_x*2 : MIN_SHAPE_SIZE;
...@@ -548,5 +622,6 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide, ...@@ -548,5 +622,6 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
} }
//--------------------------------------------------------export---------------------------------------------------- //--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {}; window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].SHAPE_ASPECTS = SHAPE_ASPECTS;
window['AscFormat'].NewShapeTrack = NewShapeTrack; window['AscFormat'].NewShapeTrack = NewShapeTrack;
})(window); })(window);
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
*/ */
"use strict"; "use strict";
(function(window, undefined){
var TRANSLATE_HANDLE_NO_FLIP = []; var TRANSLATE_HANDLE_NO_FLIP = [];
TRANSLATE_HANDLE_NO_FLIP[0] = 0; TRANSLATE_HANDLE_NO_FLIP[0] = 0;
TRANSLATE_HANDLE_NO_FLIP[1] = 1; TRANSLATE_HANDLE_NO_FLIP[1] = 1;
...@@ -64,81 +66,6 @@ TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[5] = 1; ...@@ -64,81 +66,6 @@ TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[5] = 1;
TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[6] = 2; TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[6] = 2;
TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[7] = 3; TRANSLATE_HANDLE_FLIP_H_AND_FLIP_V[7] = 3;
var SHAPE_ASPECTS = {};
SHAPE_ASPECTS["can"] = 3616635/4810125;
SHAPE_ASPECTS["moon"] = 457200/914400;
SHAPE_ASPECTS["leftBracket"] = 73152/914400;
SHAPE_ASPECTS["rightBracket"] = 73152/914400;
SHAPE_ASPECTS["leftBrace"] = 155448/914400;
SHAPE_ASPECTS["rightBrace"] = 155448/914400;
SHAPE_ASPECTS["triangle"] = 1060704/914400;
SHAPE_ASPECTS["parallelogram"] = 1216152/914400;
SHAPE_ASPECTS["trapezoid"] = 914400/1216152;
SHAPE_ASPECTS["pentagon"] = 960120/914400;
SHAPE_ASPECTS["hexagon"] = 1060704/914400;
SHAPE_ASPECTS["bracePair"] = 1069848/914400;
SHAPE_ASPECTS["rightArrow"] = 978408/484632;
SHAPE_ASPECTS["leftArrow"] = 978408/484632;
SHAPE_ASPECTS["upArrow"] = 484632/978408;
SHAPE_ASPECTS["downArrow"] = 484632/978408;
SHAPE_ASPECTS["leftRightArrow"] = 1216152/484632;
SHAPE_ASPECTS["upDownArrow"] = 484632/1216152;
SHAPE_ASPECTS["bentArrow"] = 813816/868680;
SHAPE_ASPECTS["uturnArrow"] = 886968/877824;
SHAPE_ASPECTS["bentUpArrow"] = 850392/731520;
SHAPE_ASPECTS["curvedRightArrow"] = 731520/1216152;
SHAPE_ASPECTS["curvedLeftArrow"] = 731520/1216152;
SHAPE_ASPECTS["curvedUpArrow"] = 1216152/731520;
SHAPE_ASPECTS["curvedDownArrow"] = 1216152/731520;
SHAPE_ASPECTS["stripedRightArrow"] = 978408/484632;
SHAPE_ASPECTS["notchedRightArrow"] = 978408/484632;
SHAPE_ASPECTS["homePlate"] = 978408/484632;
SHAPE_ASPECTS["leftRightArrowCallout"] = 1216152/576072;
SHAPE_ASPECTS["flowChartProcess"] = 914400/612648;
SHAPE_ASPECTS["flowChartAlternateProcess"] = 914400/612648;
SHAPE_ASPECTS["flowChartDecision"] = 914400/612648;
SHAPE_ASPECTS["flowChartInputOutput"] = 914400/612648;
SHAPE_ASPECTS["flowChartPredefinedProcess"] = 914400/612648;
SHAPE_ASPECTS["flowChartDocument"] = 914400/612648;
SHAPE_ASPECTS["flowChartMultidocument"] = 1060704/758952;
SHAPE_ASPECTS["flowChartTerminator"] = 914400/301752;
SHAPE_ASPECTS["flowChartPreparation"] = 1060704/612648;
SHAPE_ASPECTS["flowChartManualInput"] = 914400/457200;
SHAPE_ASPECTS["flowChartManualOperation"] = 914400/612648;
SHAPE_ASPECTS["flowChartPunchedCard"] = 914400/804672;
SHAPE_ASPECTS["flowChartPunchedTape"] = 914400/804672;
SHAPE_ASPECTS["flowChartPunchedTape"] = 457200/914400;
SHAPE_ASPECTS["flowChartSort"] = 457200/914400;
SHAPE_ASPECTS["flowChartOnlineStorage"] = 914400/612648;
SHAPE_ASPECTS["flowChartMagneticDisk"] = 914400/612648;
SHAPE_ASPECTS["flowChartMagneticDrum"] = 914400/685800;
SHAPE_ASPECTS["flowChartDisplay"] = 914400/612648;
SHAPE_ASPECTS["ribbon2"] = 1216152/612648;
SHAPE_ASPECTS["ribbon"] = 1216152/612648;
SHAPE_ASPECTS["ellipseRibbon2"] = 1216152/758952;
SHAPE_ASPECTS["ellipseRibbon"] = 1216152/758952;
SHAPE_ASPECTS["verticalScroll"] = 1033272/1143000;
SHAPE_ASPECTS["horizontalScroll"] = 1143000/1033272;
SHAPE_ASPECTS["wedgeRectCallout"] = 914400/612648;
SHAPE_ASPECTS["wedgeRoundRectCallout"] = 914400/612648;
SHAPE_ASPECTS["wedgeEllipseCallout"] = 914400/612648;
SHAPE_ASPECTS["cloudCallout"] = 914400/612648;
SHAPE_ASPECTS["borderCallout1"] = 914400/612648;
SHAPE_ASPECTS["borderCallout2"] = 914400/612648;
SHAPE_ASPECTS["borderCallout3"] = 914400/612648;
SHAPE_ASPECTS["accentCallout1"] = 914400/612648;
SHAPE_ASPECTS["accentCallout2"] = 914400/612648;
SHAPE_ASPECTS["accentCallout3"] = 914400/612648;
SHAPE_ASPECTS["callout1"] = 914400/612648;
SHAPE_ASPECTS["callout2"] = 914400/612648;
SHAPE_ASPECTS["callout3"] = 914400/612648;
SHAPE_ASPECTS["accentBorderCallout1"] = 914400/612648;
SHAPE_ASPECTS["accentBorderCallout2"] = 914400/612648;
SHAPE_ASPECTS["accentBorderCallout3"] = 914400/612648;
var SHAPE_EXT = {}; var SHAPE_EXT = {};
SHAPE_EXT["can"] = 3616635/36000; SHAPE_EXT["can"] = 3616635/36000;
SHAPE_EXT["moon"] = 457200/36000; SHAPE_EXT["moon"] = 457200/36000;
...@@ -229,10 +156,6 @@ SHAPE_EXT["flowChartMagneticTape"] = 612648/36000; ...@@ -229,10 +156,6 @@ SHAPE_EXT["flowChartMagneticTape"] = 612648/36000;
SHAPE_EXT["actionButtonHome"] = 1042416/36000; SHAPE_EXT["actionButtonHome"] = 1042416/36000;
var MIN_SHAPE_SIZE = 1.27;//размер меньше которого нельзя уменшить автофигуру или картинку по горизонтали или вертикали var MIN_SHAPE_SIZE = 1.27;//размер меньше которого нельзя уменшить автофигуру или картинку по горизонтали или вертикали
var MIN_SHAPE_SIZE_DIV2 = MIN_SHAPE_SIZE/2.0;
var MIN_ANGLE = 0.07;
function CreatePenBrushForChartTrack() function CreatePenBrushForChartTrack()
{ {
...@@ -372,7 +295,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection) ...@@ -372,7 +295,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
this.isLine = originalObject.spPr && originalObject.spPr.geometry && originalObject.spPr.geometry.preset === "line"; this.isLine = originalObject.spPr && originalObject.spPr.geometry && originalObject.spPr.geometry.preset === "line";
this.bChangeCoef = this.translatetNumberHandle % 2 === 0 && this.originalFlipH !== this.originalFlipV; this.bChangeCoef = this.translatetNumberHandle % 2 === 0 && this.originalFlipH !== this.originalFlipV;
this.overlayObject = new OverlayObject(this.geometry, this.resizedExtX, this.resizedExtY, this.brush, this.pen, this.transform); this.overlayObject = new AscFormat.OverlayObject(this.geometry, this.resizedExtX, this.resizedExtY, this.brush, this.pen, this.transform);
this.track = function(kd1, kd2, e) this.track = function(kd1, kd2, e)
...@@ -1639,7 +1562,7 @@ function ShapeForResizeInGroup(originalObject, parentTrack) ...@@ -1639,7 +1562,7 @@ function ShapeForResizeInGroup(originalObject, parentTrack)
{ {
this.geometry.Recalculate(this.extX, this.extY); this.geometry.Recalculate(this.extX, this.extY);
} }
this.overlayObject = new OverlayObject(this.geometry, this.extX, this.extY, originalObject.brush, originalObject.pen, this.transform); this.overlayObject = new AscFormat.OverlayObject(this.geometry, this.extX, this.extY, originalObject.brush, originalObject.pen, this.transform);
this.updateSize = function(kw, kh) this.updateSize = function(kw, kh)
{ {
var _kw, _kh; var _kw, _kh;
...@@ -1733,3 +1656,11 @@ function ShapeForResizeInGroup(originalObject, parentTrack) ...@@ -1733,3 +1656,11 @@ function ShapeForResizeInGroup(originalObject, parentTrack)
}; };
}, this, []); }, this, []);
} }
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].SHAPE_EXT = SHAPE_EXT;
window['AscFormat'].CreatePenBrushForChartTrack = CreatePenBrushForChartTrack;
window['AscFormat'].ResizeTrackShapeImage = ResizeTrackShapeImage;
window['AscFormat'].ResizeTrackGroup = ResizeTrackGroup;
})(window);
...@@ -24,9 +24,13 @@ ...@@ -24,9 +24,13 @@
*/ */
"use strict"; "use strict";
(function(window, undefined){
// Import // Import
var c_oAscFill = Asc.c_oAscFill; var c_oAscFill = Asc.c_oAscFill;
var MIN_ANGLE = 0.07;
function OverlayObject(geometry, extX, extY, brush, pen, transform ) function OverlayObject(geometry, extX, extY, brush, pen, transform )
{ {
...@@ -41,7 +45,7 @@ function OverlayObject(geometry, extX, extY, brush, pen, transform ) ...@@ -41,7 +45,7 @@ function OverlayObject(geometry, extX, extY, brush, pen, transform )
if((!brush || !brush.fill || brush.fill.type === c_oAscFill.FILL_TYPE_NOFILL) && if((!brush || !brush.fill || brush.fill.type === c_oAscFill.FILL_TYPE_NOFILL) &&
(!pen || !pen.Fill || !pen.Fill || !pen.Fill.fill || pen.Fill.fill.type === c_oAscFill.FILL_TYPE_NOFILL || pen.w === 0)) (!pen || !pen.Fill || !pen.Fill || !pen.Fill.fill || pen.Fill.fill.type === c_oAscFill.FILL_TYPE_NOFILL || pen.w === 0))
{ {
var penBrush = CreatePenBrushForChartTrack(); var penBrush = AscFormat.CreatePenBrushForChartTrack();
_brush = penBrush.brush; _brush = penBrush.brush;
_pen = penBrush.pen; _pen = penBrush.pen;
} }
...@@ -570,3 +574,11 @@ function RotateTrackGroup(originalObject) ...@@ -570,3 +574,11 @@ function RotateTrackGroup(originalObject)
this.originalObject.spPr.xfrm.setRot(this.angle); this.originalObject.spPr.xfrm.setRot(this.angle);
} }
} }
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].OverlayObject = OverlayObject;
window['AscFormat'].ObjectToDraw = ObjectToDraw;
window['AscFormat'].RotateTrackGroup = RotateTrackShapeImage;
window['AscFormat'].RotateTrackGroup = RotateTrackGroup;
})(window);
\ No newline at end of file
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
*/ */
"use strict"; "use strict";
var K=1/4; (function(window, undefined){
var mt=0, lt=1, cb=2, cl=3;
function SplineCommandMoveTo(x, y) function SplineCommandMoveTo(x, y)
{ {
...@@ -375,3 +373,11 @@ function SplineForDrawer(spline) ...@@ -375,3 +373,11 @@ function SplineForDrawer(spline)
g.ds(); g.ds();
} }
} }
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].SplineCommandMoveTo = SplineCommandMoveTo;
window['AscFormat'].SplineCommandLineTo = SplineCommandLineTo;
window['AscFormat'].SplineCommandBezier = SplineCommandBezier;
window['AscFormat'].Spline = Spline;
})(window);
\ No newline at end of file
...@@ -586,12 +586,12 @@ CGraphicFrame.prototype = ...@@ -586,12 +586,12 @@ CGraphicFrame.prototype =
createRotateTrack: function() createRotateTrack: function()
{ {
return new RotateTrackShapeImage(this); return new AscFormat.RotateTrackShapeImage(this);
}, },
createResizeTrack: function(cardDirection) createResizeTrack: function(cardDirection)
{ {
return new ResizeTrackShapeImage(this, cardDirection); return new AscFormat.ResizeTrackShapeImage(this, cardDirection);
}, },
createMoveTrack: function() createMoveTrack: function()
......
...@@ -102,17 +102,17 @@ StartAddNewShape.prototype = ...@@ -102,17 +102,17 @@ StartAddNewShape.prototype =
if(!this.bMoved && this instanceof StartAddNewShape) if(!this.bMoved && this instanceof StartAddNewShape)
{ {
var ext_x, ext_y; var ext_x, ext_y;
if(typeof SHAPE_EXT[this.preset] === "number") if(typeof AscFormat.SHAPE_EXT[this.preset] === "number")
{ {
ext_x = SHAPE_EXT[this.preset]; ext_x = AscFormat.SHAPE_EXT[this.preset];
} }
else else
{ {
ext_x = 25.4; ext_x = 25.4;
} }
if(typeof SHAPE_ASPECTS[this.preset] === "number") if(typeof AscFormat.SHAPE_ASPECTS[this.preset] === "number")
{ {
var _aspect = SHAPE_ASPECTS[this.preset]; var _aspect = AscFormat.SHAPE_ASPECTS[this.preset];
ext_y = ext_x/_aspect; ext_y = ext_x/_aspect;
} }
else else
...@@ -1556,8 +1556,8 @@ SplineBezierState.prototype = ...@@ -1556,8 +1556,8 @@ SplineBezierState.prototype =
return {objectId: null, bMarker: true}; return {objectId: null, bMarker: true};
this.drawingObjects.startTrackPos = {x: x, y: y, pageIndex: pageIndex}; this.drawingObjects.startTrackPos = {x: x, y: y, pageIndex: pageIndex};
this.drawingObjects.clearTrackObjects(); this.drawingObjects.clearTrackObjects();
this.drawingObjects.addTrackObject(new Spline(this.drawingObjects, this.drawingObjects.document.theme, null, null, null, pageIndex)); this.drawingObjects.addTrackObject(new AscFormat.Spline(this.drawingObjects, this.drawingObjects.document.theme, null, null, null, pageIndex));
this.drawingObjects.arrTrackObjects[0].path.push(new SplineCommandMoveTo(x, y)); this.drawingObjects.arrTrackObjects[0].path.push(new AscFormat.SplineCommandMoveTo(x, y));
this.drawingObjects.changeCurrentState(new SplineBezierState33(this.drawingObjects, x, y,pageIndex)); this.drawingObjects.changeCurrentState(new SplineBezierState33(this.drawingObjects, x, y,pageIndex));
this.drawingObjects.resetSelection(); this.drawingObjects.resetSelection();
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
...@@ -1608,7 +1608,7 @@ SplineBezierState33.prototype = ...@@ -1608,7 +1608,7 @@ SplineBezierState33.prototype =
tr_x = tr_point.X; tr_x = tr_point.X;
tr_y = tr_point.Y; tr_y = tr_point.Y;
} }
this.drawingObjects.arrTrackObjects[0].path.push(new SplineCommandLineTo(tr_x, tr_y)); this.drawingObjects.arrTrackObjects[0].path.push(new AscFormat.SplineCommandLineTo(tr_x, tr_y));
this.drawingObjects.changeCurrentState(new SplineBezierState2(this.drawingObjects, this.pageIndex)); this.drawingObjects.changeCurrentState(new SplineBezierState2(this.drawingObjects, this.pageIndex));
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
}, },
...@@ -1752,10 +1752,10 @@ SplineBezierState3.prototype = ...@@ -1752,10 +1752,10 @@ SplineBezierState3.prototype =
spline.path.length = 1; spline.path.length = 1;
spline.path.push(new SplineCommandBezier(x1, y1, x2, y2, x3, y3)); spline.path.push(new AscFormat.SplineCommandBezier(x1, y1, x2, y2, x3, y3));
spline.path.push(new SplineCommandBezier(x4, y4, x5, y5, x6, y6)); spline.path.push(new AscFormat.SplineCommandBezier(x4, y4, x5, y5, x6, y6));
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects, this.pageIndex)); this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects, this.pageIndex));
}, },
...@@ -1974,7 +1974,7 @@ SplineBezierState5.prototype = ...@@ -1974,7 +1974,7 @@ SplineBezierState5.prototype =
lastCommand.y2 = y2; lastCommand.y2 = y2;
spline.path.push(new SplineCommandBezier(x4, y4, x5, y5, x6, y6)); spline.path.push(new AscFormat.SplineCommandBezier(x4, y4, x5, y5, x6, y6));
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects, this.pageIndex)); this.drawingObjects.changeCurrentState(new SplineBezierState4(this.drawingObjects, this.pageIndex));
}, },
......
...@@ -132,7 +132,7 @@ CTable.prototype.private_DrawTableBackgroundAndOuterBorder = function(pGraphics, ...@@ -132,7 +132,7 @@ CTable.prototype.private_DrawTableBackgroundAndOuterBorder = function(pGraphics,
var Transform = this.Parent.transform.CreateDublicate(); var Transform = this.Parent.transform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(Transform, Math.min(X_left_new, X_right_new), Math.min(Y_top, Y_bottom)); global_MatrixTransformer.TranslateAppend(Transform, Math.min(X_left_new, X_right_new), Math.min(Y_top, Y_bottom));
pGraphics.transform3(Transform, false); pGraphics.transform3(Transform, false);
ShapeDrawer.fromShape2(new ObjectToDraw(TableShd.Unifill, null, Math.abs(X_right_new - X_left_new), Math.abs(this.Pages[0].Bounds.Bottom - Y_top), null, Transform), pGraphics, null); ShapeDrawer.fromShape2(new AscFormat.ObjectToDraw(TableShd.Unifill, null, Math.abs(X_right_new - X_left_new), Math.abs(this.Pages[0].Bounds.Bottom - Y_top), null, Transform), pGraphics, null);
ShapeDrawer.draw(null); ShapeDrawer.draw(null);
pGraphics.RestoreGrState(); pGraphics.RestoreGrState();
} }
...@@ -452,7 +452,7 @@ CTable.prototype.private_DrawCellsBackround = function(pGraphics, PNum, Row_star ...@@ -452,7 +452,7 @@ CTable.prototype.private_DrawCellsBackround = function(pGraphics, PNum, Row_star
global_MatrixTransformer.TranslateAppend(Transform, Math.min(X_cell_start, X_cell_end), Math.min(Y, Y + RealHeight)); global_MatrixTransformer.TranslateAppend(Transform, Math.min(X_cell_start, X_cell_end), Math.min(Y, Y + RealHeight));
pGraphics.transform3(Transform, false); pGraphics.transform3(Transform, false);
ShapeDrawer.fromShape2(new ObjectToDraw(CellShd.Unifill, null, Math.abs(X_cell_end - X_cell_start), Math.abs(RealHeight), null, Transform), pGraphics, null); ShapeDrawer.fromShape2(new AscFormat.ObjectToDraw(CellShd.Unifill, null, Math.abs(X_cell_end - X_cell_start), Math.abs(RealHeight), null, Transform), pGraphics, null);
ShapeDrawer.draw(null); ShapeDrawer.draw(null);
} }
} }
...@@ -545,7 +545,7 @@ CTable.prototype.private_DrawCellsBackround = function(pGraphics, PNum, Row_star ...@@ -545,7 +545,7 @@ CTable.prototype.private_DrawCellsBackround = function(pGraphics, PNum, Row_star
var Transform = this.Parent.transform.CreateDublicate(); var Transform = this.Parent.transform.CreateDublicate();
global_MatrixTransformer.TranslateAppend(Transform, Math.min(X_cell_start, X_cell_end), Math.min(Y, Y + RealHeight)); global_MatrixTransformer.TranslateAppend(Transform, Math.min(X_cell_start, X_cell_end), Math.min(Y, Y + RealHeight));
pGraphics.transform3(Transform, false); pGraphics.transform3(Transform, false);
ShapeDrawer.fromShape2(new ObjectToDraw(CellShd.Unifill, null, Math.abs(X_cell_end - X_cell_start), Math.abs(RealHeight), null, Transform), pGraphics, null); ShapeDrawer.fromShape2(new AscFormat.ObjectToDraw(CellShd.Unifill, null, Math.abs(X_cell_end - X_cell_start), Math.abs(RealHeight), null, Transform), pGraphics, null);
ShapeDrawer.draw(null); ShapeDrawer.draw(null);
} }
} }
......
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