فهرست منبع

Update 'src/app/core/models/components/component.js'

Some fixes to allow the MidPoint creation through GEO file with the correct ID
(e.g. one with "1:3" was been created with ID=1)
Added iGeom header
Indentation improvements
leo 2 سال پیش
والد
کامیت
30ff403d01
1فایلهای تغییر یافته به همراه31 افزوده شده و 12 حذف شده
  1. 31 12
      src/app/core/models/components/component.js

+ 31 - 12
src/app/core/models/components/component.js

@@ -1,27 +1,46 @@
+/*
+ * iGeom by LInE
+ * Free software to student private data
+ *
+ * http://www.matematica.br/igeom
+ * http://www.usp.br/line
+ *
+ * ./app/core/models/components/component.js
+ * @version 2021/11/09
+ */
+
 import { menu as Menu } from "../../application/menu";
 import { app as App } from "../../../app";
+
 export class Component {
-  constructor(drawer, options) {
+
+  constructor (drawer, options) {
     this.options = options;
     this.states;
     this.drawer;
     this.state;
     this.setDrawer(drawer);
     this._bootstrap();
-  }
-  _bootstrap() {
+    }
+
+  _bootstrap () {
     if (this.options == undefined) return;
     Menu.add(this);
-  }
-  setDrawer(drawer) {
+    }
+
+  setDrawer (drawer) {
     this.drawer = drawer;
-  }
-  draw(e) {
-    this.drawer.draw(e);
-  }
-  click() {
+    }
+
+  // @calledby app/core/drawers/stage.js: _clickTap(e): tool.draw.bind(tool)(e);
+  draw (e) {
+    this.drawer.draw(e); // app/components/<geom obj/drawers/<geom obj>-drawer.js
+    }
+
+  click () {
     this.state = undefined;
     App.setSelectedTool(this);
     this.draw();
-  }
-}
+    }
+
+  }