@leafer/worker 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/worker.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
  class LeaferCanvas extends LeaferCanvasBase {
6552
6554
  get allowBackgroundColor() {
6553
6555
  return true;
@@ -10813,7 +10815,7 @@ var LeaferUI = function(exports) {
10813
10815
  ignoreRender(ui, false);
10814
10816
  onLoadError(ui, event, error);
10815
10817
  leafPaint.loadId = undefined;
10816
- }, paint.lod && image.getThumbSize());
10818
+ }, paint.lod && image.getThumbSize(paint.lod));
10817
10819
  if (ui.placeholderColor) {
10818
10820
  if (!ui.placeholderDelay) image.isPlacehold = true; else setTimeout(() => {
10819
10821
  if (!image.ready) {