Browse Source

[优化] 拖动显示创建区域与修改车头方向

develop
徐振升 4 years ago
parent
commit
deee72e675
  1. 38
      src/app/working-area/working-area.component.ts

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

@ -2351,21 +2351,29 @@ export class SinglePointIcon extends PIXI.Container {
event.currentTarget.parent.y = newPosition.y; event.currentTarget.parent.y = newPosition.y;
this.assetData.Point = new PIXI.Point(this.x, this.y); this.assetData.Point = new PIXI.Point(this.x, this.y);
this.workingArea.canvasData.isChange = true; this.workingArea.canvasData.isChange = true;
// // 拖动过程中判断车辆放置区域是否包含当前图标位置 // 拖动过程中判断车辆放置区域是否包含当前图标位置
// let b = false; console.log(this.position);
// this.workingArea.backgroundImage.children.forEach(item => { let b = false;
// if (item instanceof PutCarArea) { let direction = 0;
// console.log(item.polygonGraphics._bounds) this.workingArea.backgroundImage.children.forEach(item => {
// if (item.polygonGraphics.containsPoint(newPosition)) { if (item instanceof PutCarArea) {
// b = true; if (item.polygonGraphics.interactive && item.polygonGraphics.containsPoint(this.workingArea.mousePosition)) {
// } b = true;
// } direction = item.assetData.Direction;
// }); }
// if (b) { }
// console.log('当前点可以创建'); });
// } else { if (b) {
// console.log('当前点不可以创建'); // console.log('当前点可以创建');
// } this.image.filters = null;
// 设置车辆方向
this.image.angle = direction;
} else {
// console.log('当前点不可以创建');
this.image.filters = [
new OldFilmFilter()
];
}
} }
}) })
.on('rightclick', event => { .on('rightclick', event => {

Loading…
Cancel
Save