@leafer-draw/miniapp 2.0.1 → 2.0.2

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.
@@ -1897,7 +1897,10 @@ const UICreator = {
1897
1897
  list$1[tag] = UI;
1898
1898
  },
1899
1899
  get(tag, data, x, y, width, height) {
1900
- if (!list$1[tag]) debug$d.error("not register " + tag);
1900
+ if (!list$1[tag]) {
1901
+ debug$d.warn("not register " + tag);
1902
+ return undefined;
1903
+ }
1901
1904
  const ui = new list$1[tag](data);
1902
1905
  if (!isUndefined(x)) {
1903
1906
  ui.x = x;
@@ -3754,10 +3757,10 @@ function canvasPatch(drawer) {
3754
3757
  const FileHelper = {
3755
3758
  alphaPixelTypes: [ "png", "webp", "svg" ],
3756
3759
  upperCaseTypeMap: {},
3757
- mineType(type) {
3758
- if (!type || type.startsWith("image")) return type;
3760
+ mimeType(type, base = "image") {
3761
+ if (!type || type.startsWith(base)) return type;
3759
3762
  if (type === "jpg") type = "jpeg";
3760
- return "image/" + type;
3763
+ return base + "/" + type;
3761
3764
  },
3762
3765
  fileType(filename) {
3763
3766
  const l = filename.split(".");
@@ -3790,6 +3793,8 @@ const FileHelper = {
3790
3793
 
3791
3794
  const F = FileHelper;
3792
3795
 
3796
+ F.mineType = F.mimeType;
3797
+
3793
3798
  F.alphaPixelTypes.forEach(type => F.upperCaseTypeMap[type] = type.toUpperCase());
3794
3799
 
3795
3800
  const debug$8 = Debug.get("TaskProcessor");
@@ -4034,6 +4039,9 @@ const debug$7 = Debug.get("Resource");
4034
4039
 
4035
4040
  const Resource = {
4036
4041
  tasker: new TaskProcessor,
4042
+ queue: new TaskProcessor({
4043
+ parallel: 1
4044
+ }),
4037
4045
  map: {},
4038
4046
  get isComplete() {
4039
4047
  return R.tasker.isComplete;
@@ -4070,6 +4078,12 @@ const Resource = {
4070
4078
  R.set(key, value);
4071
4079
  return value;
4072
4080
  },
4081
+ loadFilm(_key, _format) {
4082
+ return undefined;
4083
+ },
4084
+ loadVideo(_key, _format) {
4085
+ return undefined;
4086
+ },
4073
4087
  destroy() {
4074
4088
  R.map = {};
4075
4089
  }
@@ -4080,12 +4094,10 @@ const R = Resource;
4080
4094
  const ImageManager = {
4081
4095
  maxRecycled: 10,
4082
4096
  recycledList: [],
4083
- patternTasker: new TaskProcessor({
4084
- parallel: 1
4085
- }),
4086
- get(config) {
4097
+ patternTasker: Resource.queue,
4098
+ get(config, type) {
4087
4099
  let image = Resource.get(config.url);
4088
- if (!image) Resource.set(config.url, image = Creator.image(config));
4100
+ if (!image) Resource.set(config.url, image = type === "film" ? Creator.film(config) : Creator.image(config));
4089
4101
  image.use++;
4090
4102
  return image;
4091
4103
  },
@@ -4120,7 +4132,7 @@ const ImageManager = {
4120
4132
  if (config.format) return config.format === format;
4121
4133
  const {url: url} = config;
4122
4134
  if (url.startsWith("data:")) {
4123
- if (url.startsWith("data:" + FileHelper.mineType(format))) return true;
4135
+ if (url.startsWith("data:" + FileHelper.mimeType(format))) return true;
4124
4136
  } else {
4125
4137
  if (url.includes("." + format) || url.includes("." + FileHelper.upperCaseTypeMap[format])) return true; else if (format === "png" && !url.includes(".")) return true;
4126
4138
  }
@@ -4136,6 +4148,9 @@ const I = ImageManager;
4136
4148
  const {IMAGE: IMAGE, create: create$1} = IncrementId;
4137
4149
 
4138
4150
  class LeaferImage {
4151
+ get tag() {
4152
+ return "Image";
4153
+ }
4139
4154
  get url() {
4140
4155
  return this.config.url;
4141
4156
  }
@@ -4164,7 +4179,7 @@ class LeaferImage {
4164
4179
  if (!this.loading) {
4165
4180
  this.loading = true;
4166
4181
  Resource.tasker.add(() => __awaiter(this, void 0, void 0, function*() {
4167
- return yield Platform.origin.loadImage(this.getLoadUrl(thumbSize), this.crossOrigin, this).then(img => {
4182
+ return yield Platform.origin["load" + this.tag](this.getLoadUrl(thumbSize), this.crossOrigin, this).then(img => {
4168
4183
  if (thumbSize) this.setThumbView(img);
4169
4184
  this.setView(img);
4170
4185
  }).catch(e => {
@@ -4238,6 +4253,9 @@ class LeaferImage {
4238
4253
  Platform.image.setPatternTransform(pattern, transform, paint);
4239
4254
  return pattern;
4240
4255
  }
4256
+ render(canvas, x, y, width, height, _leaf, _paint, _imageScaleX, _imageScaleY) {
4257
+ canvas.drawImage(this.view, x, y, width, height);
4258
+ }
4241
4259
  getLoadUrl(_thumbSize) {
4242
4260
  return this.url;
4243
4261
  }
@@ -4264,6 +4282,18 @@ class LeaferImage {
4264
4282
  }
4265
4283
  }
4266
4284
 
4285
+ class LeaferFilm extends LeaferImage {
4286
+ get tag() {
4287
+ return "Film";
4288
+ }
4289
+ }
4290
+
4291
+ class LeaferVideo extends LeaferImage {
4292
+ get tag() {
4293
+ return "Video";
4294
+ }
4295
+ }
4296
+
4267
4297
  function defineKey(target, key, descriptor, noConfigurable) {
4268
4298
  if (!noConfigurable) descriptor.configurable = descriptor.enumerable = true;
4269
4299
  Object.defineProperty(target, key, descriptor);
@@ -6152,9 +6182,11 @@ const BranchRender = {
6152
6182
  if (this.__hasMask) {
6153
6183
  this.__renderMask(canvas, options);
6154
6184
  } else {
6185
+ let child;
6155
6186
  const {children: children} = this;
6156
6187
  for (let i = 0, len = children.length; i < len; i++) {
6157
- excludeRenderBounds$1(children[i], options) || children[i].__render(canvas, options);
6188
+ child = children[i];
6189
+ excludeRenderBounds$1(child, options) || (child.__.complex ? child.__renderComplex(canvas, options) : child.__render(canvas, options));
6158
6190
  }
6159
6191
  }
6160
6192
  },
@@ -6635,6 +6667,7 @@ let Leaf = class Leaf {
6635
6667
  __drawHitPath(_canvas) {}
6636
6668
  __updateHitCanvas() {}
6637
6669
  __render(_canvas, _options) {}
6670
+ __renderComplex(_canvas, _options) {}
6638
6671
  __drawFast(_canvas, _options) {}
6639
6672
  __draw(_canvas, _options, _originCanvas) {}
6640
6673
  __clip(_canvas, _options) {}
@@ -6754,6 +6787,7 @@ let Branch = class Branch extends Leaf {
6754
6787
  this.add(item, index);
6755
6788
  noIndex || index++;
6756
6789
  }); else child = UICreator.get(child.tag, child);
6790
+ if (!child) return;
6757
6791
  }
6758
6792
  if (child.parent) child.parent.remove(child);
6759
6793
  child.parent = this;
@@ -6979,7 +7013,7 @@ class LeafLevelList {
6979
7013
  }
6980
7014
  }
6981
7015
 
6982
- const version = "2.0.1";
7016
+ const version = "2.0.2";
6983
7017
 
6984
7018
  class LeaferCanvas extends LeaferCanvasBase {
6985
7019
  get allowBackgroundColor() {
@@ -7084,8 +7118,6 @@ class LeaferCanvas extends LeaferCanvasBase {
7084
7118
  }
7085
7119
  }
7086
7120
 
7087
- const {mineType: mineType, fileType: fileType} = FileHelper;
7088
-
7089
7121
  Object.assign(Creator, {
7090
7122
  canvas: (options, manager) => new LeaferCanvas(options, manager),
7091
7123
  image: options => new LeaferImage(options)
@@ -7101,12 +7133,12 @@ function useCanvas(_canvasType, app) {
7101
7133
  };
7102
7134
  return app.createOffscreenCanvas ? app.createOffscreenCanvas(data) : app.createOffScreenCanvas(data);
7103
7135
  },
7104
- canvasToDataURL: (canvas, type, quality) => canvas.toDataURL(mineType(type), quality),
7136
+ canvasToDataURL: (canvas, type, quality) => canvas.toDataURL(FileHelper.mimeType(type), quality),
7105
7137
  canvasToBolb: (canvas, type, quality) => canvas.toBuffer(type, {
7106
7138
  quality: quality
7107
7139
  }),
7108
7140
  canvasSaveAs: (canvas, filePath, quality) => {
7109
- let data = canvas.toDataURL(mineType(fileType(filePath)), quality);
7141
+ let data = canvas.toDataURL(FileHelper.mimeType(FileHelper.fileType(filePath)), quality);
7110
7142
  data = data.substring(data.indexOf("64,") + 3);
7111
7143
  return Platform.origin.download(data, filePath);
7112
7144
  },
@@ -7140,7 +7172,7 @@ function useCanvas(_canvasType, app) {
7140
7172
  });
7141
7173
  });
7142
7174
  },
7143
- loadImage(src) {
7175
+ loadImage(src, _crossOrigin, _leaferImage) {
7144
7176
  return new Promise((resolve, reject) => {
7145
7177
  const img = Platform.canvas.view.createImage();
7146
7178
  img.onload = () => {
@@ -7152,6 +7184,14 @@ function useCanvas(_canvasType, app) {
7152
7184
  img.src = Platform.image.getRealURL(src);
7153
7185
  });
7154
7186
  },
7187
+ loadContent(url, responseType = "text") {
7188
+ return new Promise((resolve, reject) => app.request({
7189
+ url: url,
7190
+ responseType: responseType === "arrayBuffer" ? "arraybuffer" : "text",
7191
+ success: res => resolve(responseType === "json" && typeof res.data === "string" ? JSON.parse(res.data) : res.data),
7192
+ fail: reject
7193
+ }));
7194
+ },
7155
7195
  noRepeat: "repeat-x"
7156
7196
  };
7157
7197
  Platform.miniapp = {
@@ -7703,7 +7743,7 @@ class Renderer {
7703
7743
  getCellList() {
7704
7744
  return undefined;
7705
7745
  }
7706
- addBlock(block) {
7746
+ addBlock(block, _leafList) {
7707
7747
  if (!this.updateBlocks) this.updateBlocks = [];
7708
7748
  this.updateBlocks.push(block);
7709
7749
  }
@@ -7751,7 +7791,8 @@ class Renderer {
7751
7791
  __onLayoutEnd(event) {
7752
7792
  if (event.data) event.data.map(item => {
7753
7793
  let empty;
7754
- if (item.updatedList) item.updatedList.list.some(leaf => {
7794
+ const {updatedList: updatedList} = item;
7795
+ if (updatedList) updatedList.list.some(leaf => {
7755
7796
  empty = !leaf.__world.width || !leaf.__world.height;
7756
7797
  if (empty) {
7757
7798
  if (!leaf.isLeafer) debug$2.tip(leaf.innerName, ": empty");
@@ -7759,7 +7800,7 @@ class Renderer {
7759
7800
  }
7760
7801
  return empty;
7761
7802
  });
7762
- this.addBlock(empty ? this.canvas.bounds : item.updatedBounds);
7803
+ this.addBlock(empty ? this.canvas.bounds : item.updatedBounds, updatedList);
7763
7804
  });
7764
7805
  }
7765
7806
  emitRender(type, bounds, options) {
@@ -8167,13 +8208,16 @@ class TextData extends UIData {
8167
8208
  }
8168
8209
 
8169
8210
  class ImageData extends RectData {
8211
+ get __urlType() {
8212
+ return "image";
8213
+ }
8170
8214
  setUrl(value) {
8171
8215
  this.__setImageFill(value);
8172
8216
  this._url = value;
8173
8217
  }
8174
8218
  __setImageFill(value) {
8175
8219
  this.fill = value ? {
8176
- type: "image",
8220
+ type: this.__urlType,
8177
8221
  mode: "stretch",
8178
8222
  url: value
8179
8223
  } : undefined;
@@ -8673,7 +8717,10 @@ let Group = class Group extends UI {
8673
8717
  }
8674
8718
  toJSON(options) {
8675
8719
  const data = super.toJSON(options);
8676
- if (!this.childlessJSON) data.children = this.children.map(child => child.toJSON(options));
8720
+ if (!this.childlessJSON) {
8721
+ const children = data.children = [];
8722
+ this.children.forEach(child => child.skipJSON || children.push(child.toJSON(options)));
8723
+ }
8677
8724
  return data;
8678
8725
  }
8679
8726
  pick(_hitPoint, _options) {
@@ -8822,12 +8869,12 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8822
8869
  this.emitLeafer(LeaferEvent.STOP);
8823
8870
  }
8824
8871
  }
8825
- unlockLayout() {
8872
+ unlockLayout(updateLayout = true) {
8826
8873
  this.layouter.start();
8827
- this.updateLayout();
8874
+ if (updateLayout) this.updateLayout();
8828
8875
  }
8829
- lockLayout() {
8830
- this.updateLayout();
8876
+ lockLayout(updateLayout = true) {
8877
+ if (updateLayout) this.updateLayout();
8831
8878
  this.layouter.stop();
8832
8879
  }
8833
8880
  resize(size) {
@@ -10010,11 +10057,14 @@ function compute(attrName, ui) {
10010
10057
  function getLeafPaint(attrName, paint, ui) {
10011
10058
  if (!isObject(paint) || paint.visible === false || paint.opacity === 0) return undefined;
10012
10059
  let leafPaint;
10013
- const {boxBounds: boxBounds} = ui.__layout;
10014
- switch (paint.type) {
10060
+ const {boxBounds: boxBounds} = ui.__layout, {type: type} = paint;
10061
+ switch (type) {
10015
10062
  case "image":
10063
+ case "film":
10064
+ case "video":
10016
10065
  if (!paint.url) return undefined;
10017
10066
  leafPaint = PaintImage.image(ui, attrName, paint, boxBounds, !recycleMap || !recycleMap[paint.url]);
10067
+ if (type !== "image") PaintImage[type](leafPaint);
10018
10068
  break;
10019
10069
 
10020
10070
  case "linear":
@@ -10030,7 +10080,7 @@ function getLeafPaint(attrName, paint, ui) {
10030
10080
  break;
10031
10081
 
10032
10082
  case "solid":
10033
- const {type: type, color: color, opacity: opacity} = paint;
10083
+ const {color: color, opacity: opacity} = paint;
10034
10084
  leafPaint = {
10035
10085
  type: type,
10036
10086
  style: ColorConvert.string(color, opacity)
@@ -10074,7 +10124,7 @@ const {isSame: isSame} = BoundsHelper;
10074
10124
 
10075
10125
  function image(ui, attrName, paint, boxBounds, firstUse) {
10076
10126
  let leafPaint, event;
10077
- const image = ImageManager.get(paint);
10127
+ const image = ImageManager.get(paint, paint.type);
10078
10128
  if (cache && paint === cache.paint && isSame(boxBounds, cache.boxBounds)) {
10079
10129
  leafPaint = cache.leafPaint;
10080
10130
  } else {
@@ -10135,8 +10185,8 @@ function image(ui, attrName, paint, boxBounds, firstUse) {
10135
10185
  }
10136
10186
 
10137
10187
  function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds) {
10138
- if (attrName === "fill" && !ui.__.__naturalWidth) {
10139
- const data = ui.__;
10188
+ const data = ui.__;
10189
+ if (attrName === "fill" && !data.__naturalWidth) {
10140
10190
  data.__naturalWidth = image.width / data.pixelRatio;
10141
10191
  data.__naturalHeight = image.height / data.pixelRatio;
10142
10192
  if (data.__autoSide) {
@@ -10148,7 +10198,12 @@ function checkSizeAndCreateData(ui, attrName, paint, image, leafPaint, boxBounds
10148
10198
  return false;
10149
10199
  }
10150
10200
  }
10151
- if (!leafPaint.data) PaintImage.createData(leafPaint, image, paint, boxBounds);
10201
+ if (!leafPaint.data) {
10202
+ PaintImage.createData(leafPaint, image, paint, boxBounds);
10203
+ const {transform: transform} = leafPaint.data, {opacity: opacity, blendMode: blendMode} = paint;
10204
+ const clip = transform && !transform.onlyScale || data.path || data.cornerRadius;
10205
+ if (clip || opacity && opacity < 1 || blendMode) leafPaint.complex = clip ? 2 : true;
10206
+ }
10152
10207
  return true;
10153
10208
  }
10154
10209
 
@@ -10191,7 +10246,7 @@ function getPatternData(paint, box, image) {
10191
10246
  if (paint.padding) box = tempBox.set(box).shrink(paint.padding);
10192
10247
  if (paint.mode === "strench") paint.mode = "stretch";
10193
10248
  const {width: width, height: height} = image;
10194
- const {opacity: opacity, mode: mode, align: align, offset: offset, scale: scale, size: size, rotation: rotation, skew: skew, clipSize: clipSize, repeat: repeat, gap: gap, filters: filters, interlace: interlace} = paint;
10249
+ const {mode: mode, align: align, offset: offset, scale: scale, size: size, rotation: rotation, skew: skew, clipSize: clipSize, repeat: repeat, gap: gap, interlace: interlace} = paint;
10195
10250
  const sameBox = box.width === width && box.height === height;
10196
10251
  const data = {
10197
10252
  mode: mode
@@ -10254,8 +10309,6 @@ function getPatternData(paint, box, image) {
10254
10309
  data.scaleX = scaleX;
10255
10310
  data.scaleY = scaleY;
10256
10311
  }
10257
- if (opacity && opacity < 1) data.opacity = opacity;
10258
- if (filters) data.filters = filters;
10259
10312
  if (repeat) data.repeat = isString(repeat) ? repeat === "x" ? "repeat-x" : "repeat-y" : "repeat";
10260
10313
  if (interlace) data.interlace = isNumber(interlace) || interlace.type === "percent" ? {
10261
10314
  type: "x",
@@ -10286,7 +10339,7 @@ const {get: get$2, set: set, rotateOfOuter: rotateOfOuter$1, translate: translat
10286
10339
 
10287
10340
  function stretchMode(data, box, scaleX, scaleY) {
10288
10341
  const transform = get$2(), {x: x, y: y} = box;
10289
- if (x || y) translate(transform, x, y); else transform.onlyScale = true;
10342
+ if (x || y) translate(transform, x, y); else if (scaleX > 0 && scaleY > 0) transform.onlyScale = true;
10290
10343
  scaleHelper(transform, scaleX, scaleY);
10291
10344
  data.transform = transform;
10292
10345
  }
@@ -10375,10 +10428,10 @@ function createPatternTask(paint, ui, canvas, renderOptions) {
10375
10428
  }
10376
10429
 
10377
10430
  function createPattern(paint, ui, canvas, renderOptions) {
10378
- let {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = scaleX + "-" + scaleY;
10431
+ let {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = paint.film ? paint.nowIndex : scaleX + "-" + scaleY;
10379
10432
  if (paint.patternId !== id && !ui.destroyed) {
10380
10433
  if (!(Platform.image.isLarge(paint.image, scaleX, scaleY) && !paint.data.repeat)) {
10381
- const {image: image, data: data} = paint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
10434
+ const {image: image, data: data} = paint, {opacity: opacity, filters: filters} = paint.originPaint, {transform: transform, gap: gap} = data, fixScale = PaintImage.getPatternFixScale(paint, scaleX, scaleY);
10382
10435
  let imageMatrix, xGap, yGap, {width: width, height: height} = image;
10383
10436
  if (fixScale) scaleX *= fixScale, scaleY *= fixScale;
10384
10437
  width *= scaleX;
@@ -10394,7 +10447,7 @@ function createPattern(paint, ui, canvas, renderOptions) {
10394
10447
  if (transform) copy$1(imageMatrix, transform);
10395
10448
  scale(imageMatrix, 1 / scaleX, 1 / scaleY);
10396
10449
  }
10397
- const imageCanvas = image.getCanvas(width, height, data.opacity, data.filters, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
10450
+ const imageCanvas = image.getCanvas(width, height, opacity, filters, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace);
10398
10451
  const pattern = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || "no-repeat"), imageMatrix, paint);
10399
10452
  paint.style = pattern;
10400
10453
  paint.patternId = id;
@@ -10415,15 +10468,15 @@ function getPatternFixScale(paint, imageScaleX, imageScaleY) {
10415
10468
  }
10416
10469
 
10417
10470
  function checkImage(paint, drawImage, ui, canvas, renderOptions) {
10418
- const {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions);
10471
+ const {scaleX: scaleX, scaleY: scaleY} = PaintImage.getImageRenderScaleData(paint, ui, canvas, renderOptions), id = paint.film ? paint.nowIndex : scaleX + "-" + scaleY;
10419
10472
  const {image: image, data: data, originPaint: originPaint} = paint, {exporting: exporting, snapshot: snapshot} = renderOptions;
10420
- if (!data || paint.patternId === scaleX + "-" + scaleY && !exporting || snapshot) {
10473
+ if (!data || paint.patternId === id && !exporting || snapshot) {
10421
10474
  return false;
10422
10475
  } else {
10423
10476
  if (drawImage) {
10424
10477
  if (data.repeat) {
10425
10478
  drawImage = false;
10426
- } else if (!(originPaint.changeful || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
10479
+ } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
10427
10480
  drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
10428
10481
  }
10429
10482
  }
@@ -10441,20 +10494,21 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
10441
10494
  }
10442
10495
  }
10443
10496
 
10444
- function drawImage(paint, _imageScaleX, _imageScaleY, ui, canvas, _renderOptions) {
10445
- const {data: data, image: image} = paint, {blendMode: blendMode} = paint.originPaint, {opacity: opacity, transform: transform} = data, view = image.getFull(data.filters), u = ui.__;
10446
- let {width: width, height: height} = image, clipUI;
10447
- if ((clipUI = transform && !transform.onlyScale || u.path || u.cornerRadius) || opacity || blendMode) {
10497
+ function drawImage(paint, imageScaleX, imageScaleY, ui, canvas, _renderOptions) {
10498
+ const {data: data, image: image, complex: complex} = paint;
10499
+ let {width: width, height: height} = image;
10500
+ if (complex) {
10501
+ const {blendMode: blendMode, opacity: opacity} = paint.originPaint, {transform: transform} = data;
10448
10502
  canvas.save();
10449
- clipUI && canvas.clipUI(ui);
10503
+ complex === 2 && canvas.clipUI(ui);
10450
10504
  blendMode && (canvas.blendMode = blendMode);
10451
10505
  opacity && (canvas.opacity *= opacity);
10452
10506
  transform && canvas.transform(transform);
10453
- canvas.drawImage(view, 0, 0, width, height);
10507
+ image.render(canvas, 0, 0, width, height, ui, paint, imageScaleX, imageScaleY);
10454
10508
  canvas.restore();
10455
10509
  } else {
10456
10510
  if (data.scaleX) width *= data.scaleX, height *= data.scaleY;
10457
- canvas.drawImage(view, 0, 0, width, height);
10511
+ image.render(canvas, 0, 0, width, height, ui, paint, imageScaleX, imageScaleY);
10458
10512
  }
10459
10513
  }
10460
10514
 
@@ -11395,4 +11449,4 @@ try {
11395
11449
  if (wx) useCanvas("miniapp", wx);
11396
11450
  } catch (_a) {}
11397
11451
 
11398
- export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, FourNumberHelper, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
11452
+ export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, DataHelper, Debug, Direction4, Direction9, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, FourNumberHelper, Frame, FrameData, Group, GroupData, Image, ImageData, ImageEvent, ImageManager, IncrementId, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferFilm, LeaferImage, LeaferVideo, Line, LineData, MathHelper, Matrix, MatrixHelper, MyImage, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Plugin, Point, PointHelper, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Run, Star, StarData, State, StringNumberMap, TaskItem, TaskProcessor, Text, TextConvert, TextData, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds$2 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };