Fix AvatarImage.getCroppedImage()

This commit is contained in:
Bill 2021-09-28 21:30:03 -04:00
parent 62a23cd0e2
commit c6acaff9f4

View File

@ -523,12 +523,6 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
const setTypes = this.getBodyParts(setType, this._mainAction.definition.geometryType, this._mainDirection); const setTypes = this.getBodyParts(setType, this._mainAction.definition.geometryType, this._mainDirection);
const container = new NitroContainer(); const container = new NitroContainer();
const sprite = new NitroSprite(Texture.EMPTY);
sprite.width = avatarCanvas.width;
sprite.height = avatarCanvas.height;
container.addChild(sprite);
let partCount = (setTypes.length - 1); let partCount = (setTypes.length - 1);
@ -576,7 +570,9 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
partCount--; partCount--;
} }
const image = TextureUtils.generateImage(container); const texture = TextureUtils.generateTexture(container, new Rectangle(0, 0, avatarCanvas.width, avatarCanvas.height));
const image = TextureUtils.generateImage(texture);
if(!image) return null; if(!image) return null;