浏览代码

item文档补充

haojianlong 4 年之前
父节点
当前提交
11ecd4217e

+ 1 - 1
docs/.vuepress/components/big/items/column.vue

@@ -29,7 +29,6 @@
         methods:{
             init(){
                 this.view = new SGraphView('wall');
-                this.view.scalable = false;
                 const scene = new SGraphScene();
                 this.view.scene = scene;
                 // 只模拟了轮廓数据
@@ -39,6 +38,7 @@
                 const item2 = new SColumnItem(null,{OutLine:this.outline2});
                 scene.addItem(item2);
                 this.view.fitSceneToView();
+                this.view.scalable = false;
             }
         }
     }

+ 3 - 3
docs/.vuepress/components/big/items/door.vue

@@ -15,7 +15,7 @@
             return {
                 view: null,
                 // 图中靠上位置的黑色矩形轮廓
-                outline1:[[{X:120,Y:100},{X:120,Y:300}]],
+                outline1:[[{X:12000,Y:10000},{X:12000,Y:30000}]],
                 // 图中靠下位置的,绘制多个图形,会覆盖
                 outline2:[
                     [{X:120,Y:-30},{X:120,Y:-50},{X:10,Y:-50},{X:10,Y:-30}],
@@ -29,7 +29,6 @@
         methods:{
             init(){
                 this.view = new SGraphView('wall');
-                // this.view.scalable = false;
                 const scene = new SGraphScene();
                 this.view.scene = scene;
                 // 只模拟了轮廓数据
@@ -50,7 +49,8 @@
                 //     }
                 // );
                 // scene.addItem(item2);
-                // this.view.fitSceneToView();
+                this.view.fitSceneToView();
+                // this.view.scalable = false;
             }
         }
     }

+ 1 - 1
docs/.vuepress/components/big/items/space.vue

@@ -29,7 +29,6 @@
         methods:{
             init(){
                 this.view = new SGraphView('wall');
-                this.view.scalable = false;
                 const scene = new SGraphScene();
                 this.view.scene = scene;
                 // 只模拟了轮廓数据
@@ -39,6 +38,7 @@
                 const item2 = new SSpaceItem(null,{OutLine:this.outline2});
                 scene.addItem(item2);
                 this.view.fitSceneToView();
+                this.view.scalable = false;
             }
         }
     }

+ 1 - 1
docs/.vuepress/components/big/items/wall.vue

@@ -29,7 +29,6 @@
         methods:{
             init(){
                 this.view = new SGraphView('wall');
-                this.view.scalable = false;
                 const scene = new SGraphScene();
                 this.view.scene = scene;
                 // 只模拟了轮廓数据
@@ -39,6 +38,7 @@
                 const item2 = new SWallItem(null,{OutLine:this.outline2});
                 scene.addItem(item2);
                 this.view.fitSceneToView();
+                this.view.scalable = false;
             }
         }
     }

+ 2 - 3
docs/.vuepress/components/big/items/window.vue

@@ -15,7 +15,7 @@
             return {
                 view: null,
                 // 图中靠上位置的黑色矩形轮廓
-                outline1:[[{X:120,Y:100},{X:120,Y:300}]],
+                outline1:[[{X:120,Y:-30},{X:120,Y:-50},{X:10,Y:-50},{X:10,Y:-30}]],
             }
         },
         mounted() {
@@ -24,14 +24,13 @@
         methods:{
             init(){
                 this.view = new SGraphView('wall');
-                // this.view.scalable = false;
                 const scene = new SGraphScene();
                 this.view.scene = scene;
                 // 只模拟了轮廓数据
                 const item = new SWindowItem(null,{OutLine:this.outline1});
                 scene.addItem(item);
                 this.view.fitSceneToView();
-                console.log(this.view)
+                this.view.scalable = false;
             }
         }
     }

+ 6 - 6
docs/guides/big/items/src/SDoorItem.ts

@@ -1,4 +1,4 @@
-import { SPainter, SPoint, SRect } from "@persagy-web/draw/lib";
+import {SColor, SPainter, SPoint, SRect} from "@persagy-web/draw/lib";
 import { SGraphItem } from "@persagy-web/graph/lib";
 import { Door } from "@persagy-web/big/lib/types/floor/Door";
 import { ItemColor, ItemOrder } from "@persagy-web/big/lib";
@@ -105,10 +105,10 @@ export class SDoorItem extends SGraphItem {
      */
     boundingRect(): SRect {
         return new SRect(
-            this.minX,
-            this.minY,
-            this.maxX - this.minX,
-            this.maxY - this.minY
+            0,
+            0,
+            this.r,
+            this.r
         );
     } // Function boundingRect()
 
@@ -123,7 +123,7 @@ export class SDoorItem extends SGraphItem {
         painter.pen.lineWidth = painter.toPx(1);
         painter.pen.color = ItemColor.doorColor;
         painter.drawLine(0, 0, this.r, 0);
-        painter.pen.lineDash = [5, 5];
+        painter.pen.lineDash = [50, 100];
         painter.pen.lineWidth = painter.toPx(1);
         painter.drawArc(
             -this.r,