gb-image-decoder 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -481,11 +481,11 @@ class RGBNDecoder {
481
481
  const paletteChanged = this.setPalette(palette);
482
482
  const lockFrameChanged = this.setLockFrame(lockFrame);
483
483
  const shouldUpdate = canvasChanged || paletteChanged || lockFrameChanged;
484
+ const canvases = this.setTiles(tiles);
485
+ const newHeight = this.getHeight();
484
486
  if (!shouldUpdate) {
485
487
  return;
486
488
  }
487
- const canvases = this.setTiles(tiles);
488
- const newHeight = this.getHeight();
489
489
  if (!this.canvas) {
490
490
  return;
491
491
  }
@@ -582,7 +582,7 @@ class RGBNDecoder {
582
582
  }, {});
583
583
  const { width, height } = Object.values(canvases).reduce((acc, current) => ({
584
584
  width: Math.max(current.width, acc.width),
585
- height: Math.max(current.width, acc.height)
585
+ height: Math.max(current.height, acc.height)
586
586
  }), { width: 0, height: 0 });
587
587
  canvas.width = width;
588
588
  canvas.height = height;
package/dist/index.mjs CHANGED
@@ -479,11 +479,11 @@ class RGBNDecoder {
479
479
  const paletteChanged = this.setPalette(palette);
480
480
  const lockFrameChanged = this.setLockFrame(lockFrame);
481
481
  const shouldUpdate = canvasChanged || paletteChanged || lockFrameChanged;
482
+ const canvases = this.setTiles(tiles);
483
+ const newHeight = this.getHeight();
482
484
  if (!shouldUpdate) {
483
485
  return;
484
486
  }
485
- const canvases = this.setTiles(tiles);
486
- const newHeight = this.getHeight();
487
487
  if (!this.canvas) {
488
488
  return;
489
489
  }
@@ -580,7 +580,7 @@ class RGBNDecoder {
580
580
  }, {});
581
581
  const { width, height } = Object.values(canvases).reduce((acc, current) => ({
582
582
  width: Math.max(current.width, acc.width),
583
- height: Math.max(current.width, acc.height)
583
+ height: Math.max(current.height, acc.height)
584
584
  }), { width: 0, height: 0 });
585
585
  canvas.width = width;
586
586
  canvas.height = height;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gb-image-decoder",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Decoder classes for GameBoy-encoded images",
5
5
  "repository": "",
6
6
  "license": "MIT",