Changeset 0c6b92a for imaps-frontend/src/scripts/shapes/Wall.js
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/src/scripts/shapes/Wall.js
rd565449 r0c6b92a 1 1 import Konva from "konva"; 2 import MapShape from ". /MapShape";2 import MapShape from "../base/MapShape.js"; 3 3 import { _registerNode } from 'konva/lib/Global'; 4 4 export default class Wall extends MapShape { 5 constructor(mousePos, blockSize, layer, rotation,snap, draggable = true,scaleX = 1, scaleY = 1){ 5 constructor(attrs){ 6 if(!attrs.fromLoad){ 7 attrs.height *= 8; 8 } 9 10 6 11 super( 7 12 { 8 x: mousePos.x,9 y: mousePos.y,10 width: blockSize *scaleX,11 height: blockSize * 8 *scaleY,12 fill: "# DDE0F8",13 x: attrs.position.x, 14 y: attrs.position.y, 15 width: attrs.width * attrs.scaleX, 16 height: attrs.height * attrs.scaleY, 17 fill: "#d3d3d3", 13 18 stroke: "grey", 14 19 strokeWidth: 1, 15 20 name: "mapObj", 16 draggable: draggable,17 rotation: rotation,21 draggable: true, 22 rotation: attrs.rotation, 18 23 zIndex: 0, 19 24 }, 20 layer,21 blockSize,22 snap,25 attrs.layer, 26 attrs.blockSize, 27 attrs.snap, 23 28 ); 24 25 29 this.type = "Wall"; 30 31 this.floorNum = attrs.floorNum; 26 32 } 27 } 33 34 loadInfo(attrs) { 35 this.floorNum = attrs.floor_num; 36 } 37 38 saveShapeDetails() { 39 this.setAttr("floor_num",this.floorNum) 40 } 41 } 28 42 29 43 Wall.prototype.className = 'Wall'
Note:
See TracChangeset
for help on using the changeset viewer.