From c743ba27606e4c4fdc557d8a531781b046499106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Fri, 8 Jan 2021 17:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC1.0.2.20210?= =?UTF-8?q?108=5Fbeta=20=E6=9F=A5=E7=9C=8B=E7=89=88=E6=9C=AC=E6=97=A5?= =?UTF-8?q?=E5=BF=97=EF=BC=9Ahttp://39.106.78.171:8000/ReleaseNotes/2DPlan?= =?UTF-8?q?.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debug.log | 2 ++ .../working-area/model/axArrowConnector.ts | 2 ++ src/app/working-area/model/axImageShape.ts | 2 ++ src/app/working-area/model/axLegend.ts | 22 +++++++++++-------- src/app/working-area/model/multipointIcon.ts | 4 +++- src/app/working-area/model/polygonIcon.ts | 2 ++ .../working-area/working-area.component.ts | 18 +++++---------- 7 files changed, 30 insertions(+), 22 deletions(-) diff --git a/debug.log b/debug.log index 14caa1c..666976d 100644 --- a/debug.log +++ b/debug.log @@ -6,3 +6,5 @@ [1217/162245.895:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) [1217/165122.912:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) [0104/090356.225:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) +[0108/092244.401:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) +[0108/100658.746:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3) diff --git a/src/app/working-area/model/axArrowConnector.ts b/src/app/working-area/model/axArrowConnector.ts index 68b2828..cacc7d5 100644 --- a/src/app/working-area/model/axArrowConnector.ts +++ b/src/app/working-area/model/axArrowConnector.ts @@ -50,6 +50,7 @@ export class AxArrowConnector extends AxShape { this.sortableChildren = true; this.text.zIndex = this.children.length; this.text.visible = this.showName; + this.text.angle = -this.workingArea.backgroundImage.angle; } public drawPoints() { @@ -359,6 +360,7 @@ export class AxArrowConnector extends AxShape { // c.end(); // } // } + this.text.angle = -this.workingArea.backgroundImage.angle; } paintMarker(c: PIXI.Graphics, ptX: number, ptY: number, nx: number, ny: number, size: number, arrowWidth: number, edgeWidth: number, spacing: number, initialMove: boolean) { diff --git a/src/app/working-area/model/axImageShape.ts b/src/app/working-area/model/axImageShape.ts index f496619..48b23ff 100644 --- a/src/app/working-area/model/axImageShape.ts +++ b/src/app/working-area/model/axImageShape.ts @@ -50,6 +50,7 @@ export class AxImageShape extends AxShape { downRight: PIXI.Sprite; constructor(assetData: any, workingArea: WorkingAreaComponent) { super(assetData, workingArea); + this.angle = -this.workingArea.backgroundImage.angle; this.x = this.assetData.Point.x; this.y = this.assetData.Point.y; this.name = this.assetData.Id; @@ -265,5 +266,6 @@ export class AxImageShape extends AxShape { + this.assetData.PropertyInfos?.find(item => item.PropertyName === '鍚嶇О/缂栧彿')?.PropertyValue; this.text.x = this.image.x; this.text.y = this.image.y - this.image.height / 2; + this.angle = -this.workingArea.backgroundImage.angle; } } diff --git a/src/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts index af86e70..55359cf 100644 --- a/src/app/working-area/model/axLegend.ts +++ b/src/app/working-area/model/axLegend.ts @@ -15,6 +15,7 @@ export class AxLegend extends AxShape { */ constructor(assetData: any, workingArea: WorkingAreaComponent,shapeMap:Map) { super(assetData, workingArea); + this.angle = -this.workingArea.backgroundImage.angle; this.name = this.assetData.Id; this.shapeMap = shapeMap; this.refresh(); @@ -42,15 +43,15 @@ export class AxLegend extends AxShape { refresh() { this.removeChildren(); let index = 1; - let offset = 50; + let offset = 25; let number = 2; - let width = 450; - let height = 100; + let width = 300; + let height = 50; for (let i = 0; i < number; i++){ if (i >= this.shapeMap.size) break; let x = width * i; var textImage = new Text('鍥句緥',{ - fontSize: 36, + fontSize: 20, fill: ['#0000ff'], }); textImage.anchor.set(0.5) @@ -59,7 +60,7 @@ export class AxLegend extends AxShape { this.addChild(textImage); var textName = new Text("鍚嶇О"+' 銆愭暟閲忋',{ - fontSize: 36, + fontSize: 20, fill: ['#0000ff'], }); textName.anchor.set(0,0.5); @@ -71,14 +72,16 @@ export class AxLegend extends AxShape { let x = index % number === 0 ? (number -1) * width : (index % number - 1) * width; let y = Math.ceil(index / number) * height; let image: Sprite = Sprite.from(item.ImageUrl); - image.width = 64; - image.height = 64; + image.width = 32; + image.height = 32; image.anchor.set(0.5); image.x = x; image.y = y; this.addChild(image); - var textName = new Text(item.Name+' 銆'+item.Count.toString()+'銆'); + var textName = new Text(item.Name+' 銆'+item.Count.toString()+'銆',{ + fontSize: 20, + }); textName.anchor.set(0,0.5); textName.x = x + image.width/2 + offset; textName.y = y; @@ -89,7 +92,7 @@ export class AxLegend extends AxShape { let rect = this.getLocalBounds(); this.pen.clear(); this.pen.beginFill(0xffffff,0.01); - this.pen.lineStyle(5, 0x000000); + this.pen.lineStyle(3, 0x000000); this.pen.moveTo(rect.left-offset, rect.top-offset); this.pen.lineTo(rect.right+offset, rect.top-offset); this.pen.lineTo(rect.right+offset, rect.bottom+offset); @@ -98,6 +101,7 @@ export class AxLegend extends AxShape { this.pen.endFill(); } this.addChild(this.pen); + this.angle = -this.workingArea.backgroundImage.angle; } } diff --git a/src/app/working-area/model/multipointIcon.ts b/src/app/working-area/model/multipointIcon.ts index 2416956..a8bd056 100644 --- a/src/app/working-area/model/multipointIcon.ts +++ b/src/app/working-area/model/multipointIcon.ts @@ -36,7 +36,7 @@ export class MultipointIcon extends AxShape { * @param points 鐐归泦鍚 */ constructor(assetData: any,workingArea: WorkingAreaComponent) { - super(assetData,workingArea); + super(assetData, workingArea); this.name = this.assetData.Id; this.pointsData = this.assetData.MultiPoint; this.x = this.assetData.Point.x; @@ -46,6 +46,7 @@ export class MultipointIcon extends AxShape { this.text.anchor.set(0.5,0.5); // this.text.position = this.getLineCenter(this.pointsData[0], this.pointsData[1]); this.text.visible = this.showName; + this.text.angle = -this.workingArea.backgroundImage.angle; this.addChild(this.text); // 鐢荤嚎鍥炬爣 for (let i = 0, count = this.pointsData.length - 1; i < count; i++) { @@ -198,5 +199,6 @@ export class MultipointIcon extends AxShape { this.text.text = this.assetData.Name + '\r\n' + this.assetData.PropertyInfos.find(item => item.PropertyName === '鍚嶇О/缂栧彿')?.PropertyValue; + this.text.angle = -this.workingArea.backgroundImage.angle; } } diff --git a/src/app/working-area/model/polygonIcon.ts b/src/app/working-area/model/polygonIcon.ts index 1bf4f42..7aa9a40 100644 --- a/src/app/working-area/model/polygonIcon.ts +++ b/src/app/working-area/model/polygonIcon.ts @@ -75,6 +75,7 @@ export class PolygonIcon extends AxShape { this.text.anchor.set(0.5); this.text.position = this.calculatePolygonGravityCenter(this.pointsData); this.text.visible = this.showName; + this.text.angle = -this.workingArea.backgroundImage.angle; // console.log(this.calculatePolygonGravityCenter(this.pointsData)); this.polygonGraphics.addChild(this.text); // 娣诲姞鍦嗙偣浜嬩欢 @@ -194,5 +195,6 @@ export class PolygonIcon extends AxShape { this.polygonGraphics.beginFill(color, angle); this.polygonGraphics.drawPolygon(this.getPoints()); this.polygonGraphics.endFill(); + this.text.angle = -this.workingArea.backgroundImage.angle; } } diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 33876f2..d7344f1 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -141,7 +141,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // Beta鐗: 璇ョ増鏈浉瀵逛簬伪鐗堝凡鏈変簡寰堝ぇ鐨勬敼杩涳紝娑堥櫎浜嗕弗閲嶇殑閿欒锛屼絾杩樻槸瀛樺湪鐫涓浜涚己闄凤紝闇瑕佺粡杩囧娆℃祴璇曟潵杩涗竴姝ユ秷闄わ紝姝ょ増鏈富瑕佺殑淇敼瀵瑰儚鏄蒋浠剁殑UI銆 // RC鐗: 璇ョ増鏈凡缁忕浉褰撴垚鐔熶簡锛屽熀鏈笂涓嶅瓨鍦ㄥ鑷撮敊璇殑BUG锛屼笌鍗冲皢鍙戣鐨勬寮忕増鐩稿樊鏃犲嚑銆 // Release鐗: 璇ョ増鏈剰鍛斥滄渶缁堢増鏈濓紝鍦ㄥ墠闈㈢増鏈殑涓绯诲垪娴嬭瘯鐗堜箣鍚庯紝缁堝綊浼氭湁涓涓寮忕増鏈紝鏄渶缁堜氦浠樼敤鎴蜂娇鐢ㄧ殑涓涓増鏈傝鐗堟湰鏈夋椂涔熺О涓烘爣鍑嗙増銆備竴鑸儏鍐典笅锛孯elease涓嶄細浠ュ崟璇嶅舰寮忓嚭鐜板湪杞欢灏侀潰涓婏紝鍙栬屼唬涔嬬殑鏄鍙仿 - public VERSION = '1.0.1.20210108_beta'; + public VERSION = '1.0.2.20210108_beta'; /** * 鏁版嵁鍒濆鍖 */ @@ -491,17 +491,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.selection.select(obj); }); } - // /** - // * 鍒涘缓鑳屾櫙鍥 - // */ - // public createBackground(imageUrl:string,imageAngle:number) { - // if (this.backgroundImage !== null) { - // this.backgroundImage.destroy(); - // this.backgroundImage = null; - // } - // this.createBackgroundImage() - // this.refreshBackgroundImage(imageUrl,imageAngle); - // } /** * 鍒涘缓妤煎眰鍥惧舰 */ @@ -908,6 +897,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // 璁剧疆鍥剧墖缂╂斁 this.backgroundImage.scale.set(scale); this.backgroundImage.visible = true; + this.backgroundImage.children.forEach((item) => { + if (item instanceof AxShape) { + item.refresh(); + } + }) } } /**