chore: tidy

This commit is contained in:
cha0s 2021-03-26 16:18:47 -05:00
parent 8eb0b28bf2
commit bf7a1cca06

View File

@ -110,16 +110,14 @@ export default class TilesView extends Container {
if (!slice) {
return;
}
// const mask = this.renderMask(rectangle);
const [tw, th] = this.tileset.tileSize;
// if (mask) {
// mask.anchor = [0, 0];
// }
const rw = cw * tw;
const container = new Container();
// const mask = this.renderMask(rectangle);
// if (mask) {
// container.mask = mask;
// mask.anchor = [0, 0];
// }
const [tw, th] = this.tileset.tileSize;
const rw = cw * tw;
let [x, y] = [0, 0];
for (let i = 0; i < slice.length; ++i) {
const index = slice[i];
@ -145,16 +143,16 @@ export default class TilesView extends Container {
// }
const canvas = new Canvas([rw, ch * th]);
canvas.render(renderable, this.renderer);
const sprite = new Sprite(canvas.toImage());
sprite.anchor = [0, 0];
sprite.position = [cux * cw * tw, cuy * ch * th];
this.rendered[this.constructor.hashChunk([cux, cuy])] = sprite;
this.addChild(sprite);
container.destroy();
// if (mask) {
// mask.destroy();
// }
const sprite = new Sprite(canvas.toImage());
sprite.anchor = [0, 0];
sprite.position = [cux * cw * tw, cuy * ch * th];
canvas.destroy();
this.rendered[this.constructor.hashChunk([cux, cuy])] = sprite;
this.addChild(sprite);
}
// eslint-disable-next-line class-methods-use-this