Browse Source

完善 绘制水带可以点击在已创建图标上进行绘制

tangshan
徐振升 3 years ago
parent
commit
c779727411
  1. 3
      src/app/working-area/model/axShape.ts
  2. 8
      src/app/working-area/working-area.component.ts

3
src/app/working-area/model/axShape.ts

@ -2,6 +2,7 @@ import { Constructor } from '@angular/material/core/common-behaviors/constructor
import * as PIXI from 'pixi.js';
import { Point, Rectangle, Graphics, Container } from 'pixi.js';
import { WorkingAreaComponent } from '../working-area.component';
import { PaintMode } from './paintModel';
/**
*
@ -35,6 +36,7 @@ export class AxShape extends Graphics {
// this.buttonMode = true;
this
.on('pointerdown', event => {
if (workingArea.getPaintMode() !== PaintMode.Pipeline) {
event.stopPropagation();
if (this.allowSelect
&& event.data.button === 0) {
@ -44,6 +46,7 @@ export class AxShape extends Graphics {
this.mouseDragging = true;
this.mousePosition = event.data.getLocalPosition(this.workingArea.backgroundImage);
}
}
})
.on('pointerup', event => {
this.mouseDragging = false;

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

@ -779,7 +779,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.enterPaint();
});
this.backgroundImage.addChild(this.enterPaintEndButton);
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length + 200;
this.enterPaintEndButton.visible = false;
}
/**
@ -865,7 +865,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
if (this.paintPoints.length >= 2) {
this.enterPaintEndButton.position = this.circleShadow.position;
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length + 200;
}
if (this.paintingIcon !== null) {
@ -932,7 +932,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.enterPaintEndButton.position = this.circleShadow.position;
} else if (this.paintPoints.length >= 3) {
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length + 200;
}
this.paintPoints.forEach((value, index, array) => {
if (index === 0) {
@ -961,7 +961,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.previewLineSegment.visible = true;
this.enterPaintEndButton.position = this.circleShadow.position;
this.enterPaintEndButton.visible = true;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length;
this.enterPaintEndButton.zIndex = this.backgroundImage.children.length + 200;
// this.currentClickPoint.position = new PIXI.Point(this.circleShadow.x, this.circleShadow.y);
// this.paintPoints.push(new PIXI.Point(this.circleShadow.x, this.circleShadow.y));
var point = new PIXI.Point(this.circleShadow.x, this.circleShadow.y);

Loading…
Cancel
Save