From 54ecece34bfdb4c37cc834bc9ba0a7b3ddcda070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=8C=AF=E5=8D=87?= <359059686@qq.com> Date: Sat, 20 Feb 2021 09:28:09 +0800 Subject: [PATCH] 1.2.2 --- .../working-area/working-area.component.ts | 47 +++++++++++++------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index bee4eed..fae03ae 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -162,7 +162,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 重大调整-主版本号增加 * 日期变更-日期版本号增加 */ - public VERSION = '1.2.1.20210207_beta'; + public VERSION = '1.2.2.20210220_beta'; /** * 数据初始化 */ @@ -992,24 +992,41 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV if (imageUrl === undefined || imageUrl === null || imageUrl === '') { this.backgroundImage.texture = this.backgroundTexture; } else { - this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); + // this.backgroundImage.texture = await PIXI.Texture.fromURL(imageUrl); + if (imageWidth !== undefined + && imageWidth !== null + && imageWidth !== 0 + && imageHeight !== undefined + && imageHeight !== null + && imageHeight !== 0) { + // console.log(imageWidth, imageHeight); + // this.backgroundImage.width = imageWidth; + // this.backgroundImage.height = imageHeight; + this.backgroundImage.texture = + await PIXI.Texture.fromURL(imageUrl + '?x-oss-process=image/resize,m_fixed,h_' + imageHeight + ',w_' + imageWidth); // 图片处理 + } else { + // this.backgroundImage.width = this.backgroundImage.texture.width; + // this.backgroundImage.height = this.backgroundImage.texture.height; + this.backgroundImage.texture = + await PIXI.Texture.fromURL(imageUrl); // 请求原图 + } } this.backgroundImage.angle = imageAngle; - if (imageWidth !== undefined - && imageWidth !== null - && imageWidth !== 0 - && imageHeight !== undefined - && imageHeight !== null - && imageHeight !== 0) { - console.log(imageWidth, imageHeight); - this.backgroundImage.width = imageWidth; - this.backgroundImage.height = imageHeight; - } else { - this.backgroundImage.width = this.backgroundImage.texture.width; - this.backgroundImage.height = this.backgroundImage.texture.height; - } + // if (imageWidth !== undefined + // && imageWidth !== null + // && imageWidth !== 0 + // && imageHeight !== undefined + // && imageHeight !== null + // && imageHeight !== 0) { + // console.log(imageWidth, imageHeight); + // this.backgroundImage.width = imageWidth; + // this.backgroundImage.height = imageHeight; + // } else { + // this.backgroundImage.width = this.backgroundImage.texture.width; + // this.backgroundImage.height = this.backgroundImage.texture.height; + // } this.backgroundImage.x = this.backgroundImage.width / 2; this.backgroundImage.y = this.backgroundImage.height / 2;