Browse Source

1.2.2

master
徐振升 4 years ago
parent
commit
4ce4226440
  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 === '') {
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;

Loading…
Cancel
Save