1234567891011121314151617181920212223242526272829303132 |
- import { SGraphScene } from "@saga-web/graph/lib"
- import { SMouseEvent } from "@saga-web/base/lib"
- import { SPoint } from "@saga-web/draw/lib"
- import { SFloorParser, SImageItem, STextItem, SLineItem, SPolylineItem } from "@saga-web/big"
- export class FloorScene extends SGraphScene {
- isLining: boolean = false
- constructor() {
- super()
- // this.selectContainer.connect("listChange", this, this.listChange)
- }
- // listChange(item, list) {
- // console.log(arguments)
- // }
- onMouseDown(event: SMouseEvent): boolean {
- if (this.isLining) {
- if (this.grabItem instanceof SPolylineItem) {
- return super.onMouseDown(event)
- } else {
- const item = new SPolylineItem(null, new SPoint(event.x, event.y))
- this.addItem(item)
- this.grabItem = item
- return true
- }
- } else {
- return super.onMouseDown(event)
- }
- }
- }
|