xushiting 2 anos atrás
pai
commit
5627f08137

+ 9 - 4
src/graphic/Controls/UIControl.js

@@ -20,7 +20,7 @@ export default class UIControl {
   constructor(layer, newsletter, graphicStateUI) {
     this.layer = layer;
     this.newsletter = newsletter;
-    this.graphicStateUI = graphicStateUI
+    this.graphicStateUI = graphicStateUI;
   }
 
   get selectUI() {
@@ -142,7 +142,7 @@ export default class UIControl {
     this.layer.history.goPreState();
 
     const historyState = historyService.getHistoryState();
-    this.graphicStateUI.canRevoke = historyState.pre
+    this.graphicStateUI.canRevoke = historyState.pre;
     // if (historyState.pre) {
     //     this.layer.$xui.toolbar.recall = true
     // } else {
@@ -159,8 +159,8 @@ export default class UIControl {
     this.layer.history.goNextState();
 
     const historyState = historyService.getHistoryState();
-    this.graphicStateUI.canRecovery = historyState.next
-    this.graphicStateUI.canRevoke = true
+    this.graphicStateUI.canRecovery = historyState.next;
+    this.graphicStateUI.canRevoke = true;
     // if (historyState.next) {
     //   this.layer.$xui.toolbar.recover = true;
     // } else {
@@ -172,6 +172,11 @@ export default class UIControl {
     this.layer.recoveryHistory();
   }
 
+  menu_backgroundImg(value) {
+    //
+    this.graphicStateUI.canRevoke = !value;
+  }
+
   menu_clear() {
     dataService.clear();
     elementService.hideAll();

+ 1 - 0
src/graphic/Geometry/Img.js

@@ -6,6 +6,7 @@ export default class Img extends Geometry {
     super();
     this.src = null;
     this.angle = 0;
+    this.display = true;
     this.geoType = VectorType.Img;
     this.setId(vectorId);
     this.setSrc(src);

+ 4 - 2
src/graphic/Load.js

@@ -8,7 +8,9 @@ export default class Load {
     this.newVectorId = null;
   }
 
-  load(data) {}
+  load(dataLocal, data3d) {}
 
-  upload() {}
+  save() {
+    return dataService.vectorData;
+  }
 }

+ 5 - 5
src/graphic/Renderer/Render.js

@@ -37,19 +37,19 @@ export default class Render {
         break;
       case VectorType.Circle:
         draw.drawCircle(vector);
-        break
+        break;
       case VectorType.BackgroundImg:
         draw.drawBackGroundImg();
-        break
+        break;
       case VectorType.Magnifier:
-        draw.drawMagnifier(vector)
+        draw.drawMagnifier(vector);
         break;
     }
   }
 
   //绘制交互的元素
   drawElement(vector) {
-    console.log(vector)
+    console.log(vector);
     if (draw.context == null) {
       return;
     }
@@ -148,7 +148,7 @@ export default class Render {
     }
     const magnifiers = dataService.getMagnifiers();
     for (let magnifiersKey in magnifiers) {
-      this.drawGeometry(magnifiers[magnifiersKey])
+      this.drawGeometry(magnifiers[magnifiersKey]);
     }
 
     //this.drawGeometry(dataService.getImg());