陈鹏飞 4 years ago
parent
commit
3125cf9eef
  1. 2
      src/app/working-area/model/axArrowConnector.ts
  2. 24
      src/app/working-area/working-area.component.ts

2
src/app/working-area/model/axArrowConnector.ts

@ -47,9 +47,9 @@ export class AxArrowConnector extends AxShape {
*/
public refresh(c: PIXI.Graphics, pts: PIXI.Point[]): void {
if (pts.length < 2) {
this.text.position = pts[0];
return;
}
this.text.position = pts[0];
const strokeWidth = 1;
const startWidth = 30 + strokeWidth;
const endWidth = 30 + strokeWidth;

24
src/app/working-area/working-area.component.ts

@ -506,6 +506,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.setPaintMode(PaintMode.endPaint);
this.resetCanvas();
this.destroyBackgroundImage();
if (this.canvasData.selectStorey.imageUrl === null) {
return;
}
console.log(this.canvasData.selectStorey.imageUrl);
await this.createBackgroundImage(this.canvasData.selectStorey.imageUrl);
this.createFloorShape();
if (this.canvasData.gameMode === GameMode.Assignment) {
@ -531,7 +535,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
const polygonIcon = new PolygonIcon(floorData[key], this);
break;
case 3:
const pipeline = new Pipeline(floorData[key], this);
if (floorData[key].Name === '水带') {
const pipeline = new Pipeline(floorData[key], this);
} else {
const wall = new AxArrowConnector(floorData[key], this);
}
break;
}
});
@ -640,7 +648,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.backgroundImage.y = this.app.view.height / 2;
this.backgroundImage.interactive = true;
this.backgroundImage.name = 'background';
this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle;
// const left = this.init.element.nativeElement.querySelector('.functionalDomainLeft').clientWidth;
// const right = this.init.element.nativeElement.querySelector('.functionalDomainRight').clientWidth;
const imageWidth = this.backgroundImage.texture.width;
@ -920,9 +928,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
if (!this.canvasData.selectStorey.imageUrl) {
this.backgroundImage.visible = false;
} else {
this.backgroundImage.texture = PIXI.Texture.from(this.canvasData.selectStorey.imageUrl);
this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle;
this.backgroundImage.visible = true;
// this.backgroundImage.texture = PIXI.Texture.from(this.canvasData.selectStorey.imageUrl);
// this.backgroundImage.angle = this.canvasData.selectStorey.imageAngle;
// this.backgroundImage.visible = true;
this.refresh();
}
}
/**
@ -1152,7 +1161,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.emit('createIcon', polygonIcon);
}
case PaintMode.Pipeline:
this.paintingShape = null;
if (this.canvasData.selectTemplateData.name !== '水带') {
this.emit('createIcon', this.paintingShape);
this.paintingShape = null;
}
break;
}
this.paintPoints.splice(0, this.paintPoints.length);

Loading…
Cancel
Save