From 47143497e1cb27d66e75e40067456b9cfce41d8e 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 10:19:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E5=88=B01.?= =?UTF-8?q?0.1.20210108=5Fbeta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../working-area/working-area.component.ts | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 907ce3e..33876f2 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版: 该版本意味“最终版本”,在前面版本的一系列测试版之后,终归会有一个正式版本,是最终交付用户使用的一个版本。该版本有时也称为标准版。一般情况下,Release不会以单词形式出现在软件封面上,取而代之的是符号®。 - public VERSION = '1.0.0.20210107_beta'; + public VERSION = '1.0.1.20210108_beta'; /** * 数据初始化 */ @@ -887,7 +887,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 刷新背景图 */ public async refreshBackgroundImage(imageUrl:string = this.canvasData.selectStorey.imageUrl,imageAngle:number = this.canvasData.selectStorey.imageAngle): Promise { - if (!imageUrl) { + if (imageUrl === undefined || imageUrl === null || imageUrl === "") { this.backgroundImage.visible = false; } else { this.backgroundImage.visible = false; @@ -907,6 +907,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV let scale = wScale < hScale ? wScale : hScale; // 设置图片缩放 this.backgroundImage.scale.set(scale); + this.backgroundImage.visible = true; } } /** @@ -915,23 +916,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * @param imageAngle */ public async refresh(imageUrl: string = this.canvasData.selectStorey.imageUrl, imageAngle: number = this.canvasData.selectStorey.imageAngle): Promise { - this.backgroundImage.visible = false; - this.backgroundImage.scale.set(1); - this.backgroundImage.pivot.set(0); - this.backgroundImage.x = this.app.view.width / 2; - this.backgroundImage.y = this.app.view.height / 2; - this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); - this.backgroundImage.angle = imageAngle; - // 等待图片加载完成 - let imageWidth = this.backgroundImage.texture.width; - let imageHeight = this.backgroundImage.texture.height; - let appWidth = this.app.view.width - 470; - let appHeight = this.app.view.height; - let wScale = appWidth / imageWidth; - let hScale = appHeight / imageHeight; - let scale = wScale < hScale ? wScale : hScale; - // 设置图片缩放 - this.backgroundImage.scale.set(scale); + await this.refreshBackgroundImage(); + // 清空所有图形 this.selection.deselectAll(); let itemList = []; @@ -946,12 +932,11 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // let child = this.backgroundImage.getChildByName(item); // this.backgroundImage.removeChild(child); }) - //加载当前数据 + //加载当前数据 this.createFloorShape(this.canvasData.originaleveryStoreyData.data); // 创建处置预案图形 this.createNodeShape(this.canvasData.selectPanelPoint.Data); this.createAxLegend(); - this.backgroundImage.visible = true; } /** * 创建安信图例