Browse Source

1.2.2

develop
徐振升 4 years ago
parent
commit
54ecece34b
  1. 47
      src/app/working-area/working-area.component.ts

47
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 === '') { if (imageUrl === undefined || imageUrl === null || imageUrl === '') {
this.backgroundImage.texture = this.backgroundTexture; this.backgroundImage.texture = this.backgroundTexture;
} else { } 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; this.backgroundImage.angle = imageAngle;
if (imageWidth !== undefined // if (imageWidth !== undefined
&& imageWidth !== null // && imageWidth !== null
&& imageWidth !== 0 // && imageWidth !== 0
&& imageHeight !== undefined // && imageHeight !== undefined
&& imageHeight !== null // && imageHeight !== null
&& imageHeight !== 0) { // && imageHeight !== 0) {
console.log(imageWidth, imageHeight); // console.log(imageWidth, imageHeight);
this.backgroundImage.width = imageWidth; // this.backgroundImage.width = imageWidth;
this.backgroundImage.height = imageHeight; // this.backgroundImage.height = imageHeight;
} else { // } else {
this.backgroundImage.width = this.backgroundImage.texture.width; // this.backgroundImage.width = this.backgroundImage.texture.width;
this.backgroundImage.height = this.backgroundImage.texture.height; // this.backgroundImage.height = this.backgroundImage.texture.height;
} // }
this.backgroundImage.x = this.backgroundImage.width / 2; this.backgroundImage.x = this.backgroundImage.width / 2;
this.backgroundImage.y = this.backgroundImage.height / 2; this.backgroundImage.y = this.backgroundImage.height / 2;

Loading…
Cancel
Save