@leafer-editor/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.
@@ -246,11 +246,13 @@ const Platform = {
246
246
  const ctx = canvas.getContext("2d");
247
247
  if (opacity) ctx.globalAlpha = opacity;
248
248
  ctx.imageSmoothingEnabled = smooth === false ? false : true;
249
- if (clip) {
250
- const scaleX = width / clip.width, scaleY = height / clip.height;
251
- ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY);
252
- ctx.drawImage(image, 0, 0, image.width, image.height);
253
- } else ctx.drawImage(image, 0, 0, width, height);
249
+ if (image) {
250
+ if (clip) {
251
+ const scaleX = width / clip.width, scaleY = height / clip.height;
252
+ ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY);
253
+ ctx.drawImage(image, 0, 0, image.width, image.height);
254
+ } else ctx.drawImage(image, 0, 0, width, height);
255
+ }
254
256
  return canvas;
255
257
  },
256
258
  setPatternTransform(pattern, transform, paint) {
@@ -4220,13 +4222,13 @@ class LeaferImage {
4220
4222
  return this.url;
4221
4223
  }
4222
4224
  setThumbView(_view) {}
4223
- getThumbSize() {
4225
+ getThumbSize(_lod) {
4224
4226
  return undefined;
4225
4227
  }
4226
4228
  getMinLevel() {
4227
4229
  return undefined;
4228
4230
  }
4229
- getLevelData(_level) {
4231
+ getLevelData(_level, _width, _height) {
4230
4232
  return undefined;
4231
4233
  }
4232
4234
  clearLevels(_checkUse) {}
@@ -6958,7 +6960,7 @@ class LeafLevelList {
6958
6960
  }
6959
6961
  }
6960
6962
 
6961
- const version = "1.12.3";
6963
+ const version = "1.12.4";
6962
6964
 
6963
6965
  class LeaferCanvas extends LeaferCanvasBase {
6964
6966
  get allowBackgroundColor() {
@@ -11654,7 +11656,7 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
11654
11656
  ignoreRender(ui, false);
11655
11657
  onLoadError(ui, event, error);
11656
11658
  leafPaint.loadId = undefined;
11657
- }, paint.lod && image.getThumbSize());
11659
+ }, paint.lod && image.getThumbSize(paint.lod));
11658
11660
  if (ui.placeholderColor) {
11659
11661
  if (!ui.placeholderDelay) image.isPlacehold = true; else setTimeout(() => {
11660
11662
  if (!image.ready) {