邵佳豪 4 years ago
parent
commit
354a0d1604
  1. 19
      src/app/working-area/model/axShape.ts
  2. 8
      src/app/working-area/working-area.component.ts

19
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 * as PIXI from 'pixi.js';
import { Point, Rectangle, Graphics, Container } from 'pixi.js'; import { Point, Rectangle, Graphics, Container } from 'pixi.js';
import { WorkingAreaComponent } from '../working-area.component'; import { WorkingAreaComponent } from '../working-area.component';
import { PaintMode } from './paintModel';
/** /**
* *
@ -35,14 +36,16 @@ export class AxShape extends Graphics {
// this.buttonMode = true; // this.buttonMode = true;
this this
.on('pointerdown', event => { .on('pointerdown', event => {
event.stopPropagation(); if (workingArea.getPaintMode() !== PaintMode.Pipeline) {
if (this.allowSelect event.stopPropagation();
&& event.data.button === 0) { if (this.allowSelect
this.workingArea.select(this); && event.data.button === 0) {
} this.workingArea.select(this);
if (this.allowEdit) { }
this.mouseDragging = true; if (this.allowEdit) {
this.mousePosition = event.data.getLocalPosition(this.workingArea.backgroundImage); this.mouseDragging = true;
this.mousePosition = event.data.getLocalPosition(this.workingArea.backgroundImage);
}
} }
}) })
.on('pointerup', event => { .on('pointerup', event => {

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

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

Loading…
Cancel
Save