leafer-game 1.12.3 → 1.12.4

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/web.js CHANGED
@@ -228,11 +228,13 @@ var LeaferUI = function(exports) {
228
228
  const ctx = canvas.getContext("2d");
229
229
  if (opacity) ctx.globalAlpha = opacity;
230
230
  ctx.imageSmoothingEnabled = smooth === false ? false : true;
231
- if (clip) {
232
- const scaleX = width / clip.width, scaleY = height / clip.height;
233
- ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY);
234
- ctx.drawImage(image, 0, 0, image.width, image.height);
235
- } else ctx.drawImage(image, 0, 0, width, height);
231
+ if (image) {
232
+ if (clip) {
233
+ const scaleX = width / clip.width, scaleY = height / clip.height;
234
+ ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY);
235
+ ctx.drawImage(image, 0, 0, image.width, image.height);
236
+ } else ctx.drawImage(image, 0, 0, width, height);
237
+ }
236
238
  return canvas;
237
239
  },
238
240
  setPatternTransform(pattern, transform, paint) {
@@ -3978,13 +3980,13 @@ var LeaferUI = function(exports) {
3978
3980
  return this.url;
3979
3981
  }
3980
3982
  setThumbView(_view) {}
3981
- getThumbSize() {
3983
+ getThumbSize(_lod) {
3982
3984
  return undefined;
3983
3985
  }
3984
3986
  getMinLevel() {
3985
3987
  return undefined;
3986
3988
  }
3987
- getLevelData(_level) {
3989
+ getLevelData(_level, _width, _height) {
3988
3990
  return undefined;
3989
3991
  }
3990
3992
  clearLevels(_checkUse) {}
@@ -6547,7 +6549,7 @@ var LeaferUI = function(exports) {
6547
6549
  this.levelMap = null;
6548
6550
  }
6549
6551
  }
6550
- const version = "1.12.3";
6552
+ const version = "1.12.4";
6551
6553
  const debug$5 = Debug.get("LeaferCanvas");
6552
6554
  class LeaferCanvas extends LeaferCanvasBase {
6553
6555
  set zIndex(zIndex) {
@@ -11334,7 +11336,7 @@ var LeaferUI = function(exports) {
11334
11336
  ignoreRender(ui, false);
11335
11337
  onLoadError(ui, event, error);
11336
11338
  leafPaint.loadId = undefined;
11337
- }, paint.lod && image.getThumbSize());
11339
+ }, paint.lod && image.getThumbSize(paint.lod));
11338
11340
  if (ui.placeholderColor) {
11339
11341
  if (!ui.placeholderDelay) image.isPlacehold = true; else setTimeout(() => {
11340
11342
  if (!image.ready) {