jinx 2 年之前
父节点
当前提交
59478a86a6
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 4 0
      src/graphic/Geometry/SVG.js
  2. 3 2
      src/graphic/Service/SVGService.js

+ 4 - 0
src/graphic/Geometry/SVG.js

@@ -93,6 +93,10 @@ export default class SVG extends Geometry {
   setPoints(points){
   setPoints(points){
     this.points = points
     this.points = points
   }
   }
+  setScale(scale) {
+    this.scale = scale
+  }
+
 
 
   setBoundingVertexs2(position, pointIndex) {
   setBoundingVertexs2(position, pointIndex) {
     if (mathUtil.getDistance(position, this.center) < Constant.minAdsorbPix) {
     if (mathUtil.getDistance(position, this.center) < Constant.minAdsorbPix) {

+ 3 - 2
src/graphic/Service/SVGService.js

@@ -13,8 +13,9 @@ export default class SVGService {
 
 
   copy(vectorId) {
   copy(vectorId) {
     let SVG = dataService.getSVG(vectorId);
     let SVG = dataService.getSVG(vectorId);
-    let center = uiService.getNewPositionForPop(SVG.center);
-    let newSVG = this.create(center,SVG.type);
+    let newCenter = uiService.getNewPositionForPop(SVG.center);
+    let newSVG = this.create(newCenter,SVG.type);
+    newSVG.setScale(SVG.scale)
     return newSVG;
     return newSVG;
   }
   }
 }
 }