소스 검색

fix intersection id in save file and intersection points visibility

Victor Luiz Domingues 3 년 전
부모
커밋
86d5e315d9

+ 1 - 1
src/app/components/intersection-component/drawers/intersection-drawer.js

@@ -78,7 +78,7 @@ export class IntersectionDrawer extends Drawer {
     for (let index = 0; index < intersectionPoints.length; index++) {
       const intersectionPoint = intersectionPoints[index];
       intersectionPoint.update();
-      if (!intersectionPoint.visible) return;
+      // if (!intersectionPoint.visible) return;
       const point = PointDrawer.drawPoint(
         intersectionPoint,
         false,

+ 3 - 4
src/app/components/intersection-component/models/intersection-model.js

@@ -69,16 +69,15 @@ export class IntersectionModel extends PointModel {
     return [{ id: this.r.id }, { id: this.s.id }, { id: this.index + 1 }, { id: this.posX + 5 }, { id: this.posY - 5 }, { id: this.visible ? 1 : 0 }];
   }
 
-  bind(posX, posY, label, r, s, visible, index, id) {
-    super.bind(posX, posY, label, id);
+  bind(posX, posY, label, r, s, visible, index) {
+    super.bind(posX, posY, label);
     this.r = r;
     this.s = s;
-    super.setClass(ELEMENTS_CLASS.INTERSECTION_POINT);
     this.visible = visible;
     this.index = index;
     this.color = -65536;
     this.definitions = this.getDefinitions();
-
+    super.setClass(ELEMENTS_CLASS.INTERSECTION_POINT);
   }
 
   /**

+ 1 - 2
src/app/components/point-component/models/point-model.js

@@ -27,8 +27,7 @@ export class PointModel extends GeometricObject {
     this.posY = konvaObject.attrs.startPosY + event.target._lastPos.y;
     this.definitions = [{ id: this.posX + 5 }, { id: -this.posY - 5 }];
   }
-  bind(posX, posY, label, id) {
-    super.id = id;
+  bind(posX, posY, label) {
     this.posX = posX;
     this.posY = posY;
     this.setLabel(label);

+ 2 - 1
src/app/core/models/application/actions/action.js

@@ -35,7 +35,7 @@ export class Action {
     return map;
   }
 
-  fromMapList(map) {}
+  fromMapList(map) { }
 
   toString() {
     return (
@@ -61,6 +61,7 @@ export class Action {
     return str.replace(/,/g, " ");
   }
   rehydrate() {
+    console.info(this);
     this.id = this.genericObject.id;
     this.type = this.genericObject.elementClass;
     this.definition = this.r(