From 0ce27f140ed27c9cca47737606b3fb7afb44e0ae Mon Sep 17 00:00:00 2001 From: "DESKTOP-474NEJQ\\xzsjob" <359059686@qq.com> Date: Thu, 27 Aug 2020 15:58:03 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=20=E5=A4=9A=E8=BE=B9?= =?UTF-8?q?=E5=BD=A2=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/working-area/working-area.component.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index c320462..7e8044c 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -1079,12 +1079,15 @@ export class PolygonIcon extends PIXI.Container { this.addChild(iconPoint); }); // 填充多边形 - this.polygonGraphics.beginFill(0xDC143C, 1); + + const color: number = this.assetData.Color.substring(0, 7).replace('#', '0x'); + const angle: number = parseInt(this.assetData.Color.substring(7), 16) / 255; + this.polygonGraphics.beginFill(color, angle); this.polygonGraphics.drawPolygon(this.getPoints()); this.polygonGraphics.endFill(); this.addChild(this.polygonGraphics); // 画多边形 - this.polygonLineGraphics.lineStyle(1, 0xFFBD01, 1); + this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1); this.polygonLineGraphics.drawPolygon(this.getPoints()); this.polygonLineGraphics.closePath(); this.addChild(this.polygonLineGraphics); @@ -1092,7 +1095,7 @@ export class PolygonIcon extends PIXI.Container { this.text.anchor.set(0.5); this.text.position = this.calculatePolygonGravityCenter(this.pointsData); // console.log(this.calculatePolygonGravityCenter(this.pointsData)); - this.polygonLineGraphics.addChild(this.text); + this.polygonGraphics.addChild(this.text); // 添加圆点事件 this.pointsGraphics.forEach((item, index, array) => { item.interactive = true; @@ -1127,12 +1130,12 @@ export class PolygonIcon extends PIXI.Container { this.workingArea.canvasData.isChange = true; // 填充多边形 this.polygonGraphics.clear(); - this.polygonGraphics.beginFill(0xDC143C, 1); + this.polygonGraphics.beginFill(color, angle); this.polygonGraphics.drawPolygon(this.getPoints()); this.polygonGraphics.endFill(); // 画多边形 this.polygonLineGraphics.clear(); - this.polygonLineGraphics.lineStyle(1, 0xFFBD01, 1); + this.polygonLineGraphics.lineStyle(5, 0xFFBD01, 1); this.polygonLineGraphics.drawPolygon(this.getPoints()); this.polygonLineGraphics.closePath();