|
|
@@ -1,7 +1,7 @@
|
|
|
-import SVG from '../Geometry/SVG.js';
|
|
|
-import { dataService } from './DataService.js';
|
|
|
-import { mathUtil } from '../Util/MathUtil.js';
|
|
|
-import { uiService } from './UIService.js';
|
|
|
+import SVG from "../Geometry/SVG.js";
|
|
|
+import { dataService } from "./DataService.js";
|
|
|
+import { mathUtil } from "../Util/MathUtil.js";
|
|
|
+import { uiService } from "./UIService.js";
|
|
|
import LayerEvents from "../enum/LayerEvents.js";
|
|
|
import { addLine } from "../Controls/AddLine";
|
|
|
export default class SVGService {
|
|
|
@@ -15,7 +15,10 @@ export default class SVGService {
|
|
|
copy(vectorId) {
|
|
|
let SVG = dataService.getSVG(vectorId);
|
|
|
let newCenter = uiService.getNewPositionForPop(SVG.center);
|
|
|
- let newSVG = this.create(newCenter, SVG.type);
|
|
|
+ //为了罗敏的需求改动,要求复制出来的svg不重叠
|
|
|
+ let center = { x: SVG.center.x + 100 * SVG.scale, y: SVG.center.y - 100 * SVG.scale };
|
|
|
+ // let newSVG = this.create(newCenter, SVG.type);
|
|
|
+ let newSVG = this.create(center, SVG.type);
|
|
|
newSVG.setScale(SVG.scale);
|
|
|
for (let i = 0; i < SVG.points.length; ++i) {
|
|
|
let dx = SVG.points[i].x - SVG.center.x;
|