Browse Source

更改样式方便调试

bill 4 năm trước cách đây
mục cha
commit
03aa921ba0
3 tập tin đã thay đổi với 121 bổ sung164 xóa
  1. 15 0
      src/CAD/core/core/wallfixedline.ts
  2. 105 163
      static/data.json
  3. 1 1
      static/style/public.css

+ 15 - 0
src/CAD/core/core/wallfixedline.ts

@@ -20,6 +20,7 @@ class WallLine extends FixedLine {
   ground: SVGGElement
   origin: SVGPathElement
   temp: SVGGElement
+  testText: SVGTextElement
   
   exterior: boolean
   static minWidth = 0.1
@@ -325,6 +326,8 @@ class WallLine extends FixedLine {
     node.appendChild(this.temp)
     this.temp.setAttribute('pointer-events', 'none')
 
+    this.testText = document.createElementNS(SVGURI, 'text')
+    node.appendChild(this.testText)
     
     return node
   }
@@ -446,6 +449,18 @@ class WallLine extends FixedLine {
     
     this.temp.innerHTML = ''
 
+
+    setTimeout(() => {
+      let center = lineCenter(this)
+      this.testText.setAttribute('fill', 'red')
+      this.testText.setAttribute('text-anchor', 'middle')
+      this.testText.setAttribute('dominant-baseline', 'middle')
+      this.testText.setAttribute('x', center.x.toString())
+      this.testText.setAttribute('y', center.y.toString())
+      this.testText.setAttribute('font-size', (12*this.multiple).toString())
+      this.testText.textContent = this.renderer.processing.lines.find(({ele}) => (ele as any) === this).id + ''
+    })
+
     if (!this.showAngle && this.color !== this.hover.color) return;
 
     let joinLines = this.renderer.processing.lines.filter(line => 

+ 105 - 163
static/data.json

@@ -57,8 +57,8 @@
     },
     {
       "id": 29,
-      "x": -7.57,
-      "y": 0.06
+      "x": -7.56,
+      "y": 0.01
     },
     {
       "id": 30,
@@ -78,7 +78,7 @@
     {
       "id": 65,
       "x": 0.53,
-      "y": 3.8
+      "y": 3.78
     },
     {
       "id": 83,
@@ -93,7 +93,7 @@
     {
       "id": 87,
       "x": -1.99,
-      "y": 0.09
+      "y": 0.1
     },
     {
       "id": 96,
@@ -171,34 +171,34 @@
       "y": -3.73
     },
     {
+      "id": 193,
       "x": -1.99,
-      "y": -1.2812621359223304,
-      "id": 193
+      "y": -1.28
     },
     {
-      "x": -3.1926829268292685,
-      "y": -1.76,
-      "id": 194
+      "id": 194,
+      "x": -3.19,
+      "y": -1.76
     },
     {
-      "x": 4.105217200451013,
-      "y": 0.7275826928208085,
-      "id": 195
+      "id": 195,
+      "x": 4.11,
+      "y": 0.73
     },
     {
-      "x": 0.45787943637277795,
-      "y": -1.74276141241991,
-      "id": 196
+      "id": 196,
+      "x": 0.46,
+      "y": -1.74
     },
     {
+      "id": 197,
       "x": 3.6,
-      "y": 0.38539877300613484,
-      "id": 197
+      "y": 0.39
     },
     {
+      "id": 198,
       "x": 5.69,
-      "y": -1.48,
-      "id": 198
+      "y": -1.48
     }
   ],
   "wall": [
@@ -239,184 +239,178 @@
       "border": true
     },
     {
-      "id": 8,
+      "id": 7,
       "p1": 23,
       "p2": 29,
       "border": true
     },
     {
-      "id": 12,
+      "id": 8,
       "p1": 26,
       "p2": 29,
       "border": true
     },
     {
-      "id": 13,
+      "id": 9,
       "p1": 162,
       "p2": 29,
       "border": true
     },
     {
-      "id": 14,
+      "id": 10,
       "p1": 86,
       "p2": 28,
       "border": false
     },
     {
-      "id": 15,
+      "id": 11,
       "p1": 2,
       "p2": 3,
       "border": true
     },
     {
+      "id": 12,
       "p1": 87,
-      "p2": 193,
-      "id": 54
+      "p2": 193
     },
     {
+      "id": 13,
       "p1": 83,
-      "p2": 193,
-      "id": 55
+      "p2": 193
     },
     {
+      "id": 14,
       "p1": 24,
-      "p2": 194,
-      "id": 58
+      "p2": 194
     },
     {
+      "id": 15,
       "p1": 83,
-      "p2": 194,
-      "id": 59
+      "p2": 194
     },
     {
-      "id": 18,
+      "id": 16,
       "p1": 87,
       "p2": 86,
       "border": false
     },
     {
+      "id": 17,
       "p1": 96,
-      "p2": 195,
-      "id": 62
+      "p2": 195
     },
     {
+      "id": 18,
       "p1": 97,
-      "p2": 196,
-      "id": 66
+      "p2": 196
     },
     {
+      "id": 19,
       "p1": 195,
-      "p2": 197,
-      "id": 70
+      "p2": 197
     },
     {
+      "id": 20,
       "p1": 196,
-      "p2": 197,
-      "id": 71
+      "p2": 197
     },
     {
-      "id": 20,
+      "id": 21,
       "p1": 39,
       "p2": 38,
       "border": true
     },
     {
+      "id": 22,
       "p1": 96,
-      "p2": 193,
-      "id": 56
+      "p2": 193
     },
     {
+      "id": 23,
       "p1": 39,
-      "p2": 194,
-      "id": 60
+      "p2": 194
     },
     {
+      "id": 24,
       "p1": 193,
-      "p2": 194,
-      "id": 61
+      "p2": 194
     },
     {
-      "id": 22,
+      "id": 25,
       "p1": 97,
       "p2": 38,
       "border": true
     },
     {
-      "id": 23,
+      "id": 26,
       "p1": 148,
       "p2": 17,
       "border": false
     },
     {
-      "id": 24,
+      "id": 27,
       "p1": 183,
       "p2": 30,
       "border": true
     },
     {
+      "id": 28,
       "p1": 189,
-      "p2": 195,
-      "id": 64
+      "p2": 195
     },
     {
+      "id": 29,
       "p1": 112,
-      "p2": 195,
-      "id": 65
+      "p2": 195
     },
     {
-      "id": 27,
+      "id": 30,
       "p1": 18,
       "p2": 139,
       "border": true
     },
     {
-      "id": 30,
+      "id": 31,
       "p1": 148,
       "p2": 25,
       "border": false
     },
     {
-      "id": 31,
+      "id": 32,
       "p1": 180,
       "p2": 148,
       "border": false
     },
     {
+      "id": 33,
       "p1": 83,
-      "p2": 196,
-      "id": 68
+      "p2": 196
     },
     {
+      "id": 34,
       "p1": 25,
-      "p2": 196,
-      "id": 69
+      "p2": 196
     },
     {
-      "id": 33,
+      "id": 35,
       "p1": 21,
       "p2": 25,
       "border": true
     },
     {
-      "id": 35,
-      "p1": 65,
-      "p2": 28,
-      "border": true
-    },
-    {
-      "id": 36,
+      "id": 37,
       "p1": 3,
       "p2": 153,
       "border": true
     },
     {
-      "id": 37,
+      "id": 38,
       "p1": 2,
       "p2": 152,
       "border": true
     },
     {
-      "id": 38,
+      "id": 39,
       "p1": 153,
       "p2": 28,
       "border": true
@@ -434,58 +428,58 @@
       "border": true
     },
     {
-      "id": 44,
+      "id": 42,
       "p1": 86,
       "p2": 173,
       "border": true
     },
     {
-      "id": 45,
+      "id": 43,
       "p1": 65,
       "p2": 2,
       "border": true
     },
     {
-      "id": 47,
+      "id": 44,
       "p1": 174,
       "p2": 65,
       "border": true
     },
     {
+      "id": 45,
       "p1": 183,
-      "p2": 198,
-      "id": 74
+      "p2": 198
     },
     {
+      "id": 46,
       "p1": 180,
-      "p2": 198,
-      "id": 75
+      "p2": 198
     },
     {
-      "id": 49,
+      "id": 47,
       "p1": 139,
       "p2": 183,
       "border": true
     },
     {
+      "id": 48,
       "p1": 112,
-      "p2": 197,
-      "id": 72
+      "p2": 197
     },
     {
+      "id": 49,
       "p1": 180,
-      "p2": 197,
-      "id": 73
+      "p2": 197
     },
     {
+      "id": 50,
       "p1": 192,
-      "p2": 198,
-      "id": 76
+      "p2": 198
     },
     {
+      "id": 51,
       "p1": 189,
-      "p2": 198,
-      "id": 77
+      "p2": 198
     },
     {
       "id": 52,
@@ -498,6 +492,12 @@
       "p1": 139,
       "p2": 189,
       "border": false
+    },
+    {
+      "id": 54,
+      "p1": 65,
+      "p2": 153,
+      "border": true
     }
   ],
   "window": [
@@ -513,12 +513,12 @@
       "bottom": null
     },
     {
-      "line": 45,
+      "line": 43,
       "pos": [
         -0.12,
-        3.79,
+        3.78,
         -1.22,
-        3.79
+        3.78
       ],
       "top": null,
       "bottom": null
@@ -537,7 +537,7 @@
   ],
   "door": [
     {
-      "line": 27,
+      "line": 30,
       "pos": [
         7.83,
         3.12,
@@ -555,25 +555,7 @@
       "start": true
     },
     {
-      "line": 16,
-      "pos": [
-        -1.99,
-        -1.03,
-        -1.99,
-        -0.23
-      ],
-      "top": null,
-      "bottom": null,
-      "within": 3,
-      "show": true,
-      "ctl": [
-        -2.79,
-        -0.22999999999999998
-      ],
-      "start": false
-    },
-    {
-      "line": 30,
+      "line": 31,
       "pos": [
         3.33,
         -1.75,
@@ -585,13 +567,13 @@
       "within": 0,
       "show": true,
       "ctl": [
-        3.331273976236042,
-        -0.9494960249195026
+        3.3329090716756227,
+        -0.9500052892037435
       ],
       "start": false
     },
     {
-      "line": 36,
+      "line": 37,
       "pos": [
         -0.34,
         2.18,
@@ -603,7 +585,7 @@
       "within": 0,
       "show": true,
       "ctl": [
-        -0.33999999999999997,
+        -0.3399999999999999,
         2.96
       ],
       "start": false
@@ -625,50 +607,10 @@
     }
   ],
   "surplus": [],
-  "slideDoor": [
-    {
-      "line": 32,
-      "pos": [
-        0.19,
-        -1.75,
-        -1.59,
-        -1.76
-      ],
-      "top": null,
-      "bottom": null,
-      "within": 0,
-      "show": true
-    },
-    {
-      "line": 26,
-      "pos": [
-        5.01,
-        0.72,
-        4.37,
-        0.72
-      ],
-      "top": null,
-      "bottom": null,
-      "within": 0,
-      "show": true
-    },
-    {
-      "line": 19,
-      "pos": [
-        -2.39,
-        -3.67,
-        -1.34,
-        -2.96
-      ],
-      "top": null,
-      "bottom": null,
-      "within": 0,
-      "show": true
-    }
-  ],
+  "slideDoor": [],
   "groundCase": [
     {
-      "line": 20,
+      "line": 21,
       "pos": [
         -3.65,
         -3.63,
@@ -679,7 +621,7 @@
       "bottom": null
     },
     {
-      "line": 8,
+      "line": 7,
       "pos": [
         -7.56,
         -2.79,
@@ -814,7 +756,7 @@
   ],
   "bayCase": [
     {
-      "line": 12,
+      "line": 8,
       "pos": [
         -7.57,
         0.85,
@@ -825,10 +767,10 @@
       "bottom": null,
       "within": 0,
       "ctl": [
-        -7.118226790151344,
-        2.994725547775017,
-        -7.118226790151344,
-        0.8052744522249831
+        -7.104105856525033,
+        2.9981410376459037,
+        -7.103858588514344,
+        0.8060448685081146
       ]
     }
   ],

+ 1 - 1
static/style/public.css

@@ -20,7 +20,7 @@ html, body, .body {
 
 #cad {
   flex: 1;
-  background-color: #000;
+  background-color: #ccc;
 }
 
 .variable {