@leafer-ui/miniapp 1.4.0 → 1.4.1

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/miniapp.cjs CHANGED
@@ -486,7 +486,7 @@ class Layouter {
486
486
  }
487
487
  partLayout() {
488
488
  var _a;
489
- if (!((_a = this.__updatedList) === null || _a === undefined ? undefined : _a.length))
489
+ if (!((_a = this.__updatedList) === null || _a === void 0 ? void 0 : _a.length))
490
490
  return;
491
491
  const t = core.Run.start('PartLayout');
492
492
  const { target, __updatedList: updateList } = this;
@@ -951,9 +951,10 @@ class Selector {
951
951
  this.finder = core.Creator.finder && core.Creator.finder();
952
952
  }
953
953
  getByPoint(hitPoint, hitRadius, options) {
954
- if (core.Platform.backgrounder && this.target)
955
- this.target.updateLayout();
956
- return this.picker.getByPoint(hitPoint, hitRadius, options);
954
+ const { target, picker } = this;
955
+ if (core.Platform.backgrounder)
956
+ target && target.updateLayout();
957
+ return picker.getByPoint(hitPoint, hitRadius, options);
957
958
  }
958
959
  getBy(condition, branch, one, options) {
959
960
  return this.finder ? this.finder.getBy(condition, branch, one, options) : core.Plugin.need('find');
@@ -1437,7 +1438,7 @@ function getPatternData(paint, box, image) {
1437
1438
  box = tempBox.set(box).shrink(paint.padding);
1438
1439
  if (paint.mode === 'strench')
1439
1440
  paint.mode = 'stretch';
1440
- const { opacity, mode, align, offset, scale, size, rotation, repeat } = paint;
1441
+ const { opacity, mode, align, offset, scale, size, rotation, repeat, filters } = paint;
1441
1442
  const sameBox = box.width === width && box.height === height;
1442
1443
  const data = { mode };
1443
1444
  const swapSize = align !== 'center' && (rotation || 0) % 180 === 90;
@@ -1500,6 +1501,8 @@ function getPatternData(paint, box, image) {
1500
1501
  data.height = height;
1501
1502
  if (opacity)
1502
1503
  data.opacity = opacity;
1504
+ if (filters)
1505
+ data.filters = filters;
1503
1506
  if (repeat)
1504
1507
  data.repeat = typeof repeat === 'string' ? (repeat === 'x' ? 'repeat-x' : 'repeat-y') : 'repeat';
1505
1508
  return data;
@@ -1602,7 +1605,7 @@ function createPattern(ui, paint, pixelRatio) {
1602
1605
  scaleX = abs$1(scaleX);
1603
1606
  scaleY = abs$1(scaleY);
1604
1607
  const { image, data } = paint;
1605
- let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, opacity, transform, repeat } = data;
1608
+ let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, transform, repeat } = data;
1606
1609
  if (sx) {
1607
1610
  imageMatrix = get$1();
1608
1611
  copy$1(imageMatrix, transform);
@@ -1645,7 +1648,7 @@ function createPattern(ui, paint, pixelRatio) {
1645
1648
  }
1646
1649
  scale(imageMatrix, 1 / scaleX, 1 / scaleY);
1647
1650
  }
1648
- const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, opacity);
1651
+ const canvas = image.getCanvas(ceil(width) || 1, ceil(height) || 1, data.opacity, data.filters);
1649
1652
  const pattern = image.getPattern(canvas, repeat || (core.Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint);
1650
1653
  paint.style = pattern;
1651
1654
  paint.patternId = id;
@@ -1721,7 +1724,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
1721
1724
  canvas.opacity *= data.opacity;
1722
1725
  if (data.transform)
1723
1726
  canvas.transform(data.transform);
1724
- canvas.drawImage(paint.image.view, 0, 0, data.width, data.height);
1727
+ canvas.drawImage(paint.image.getFull(data.filters), 0, 0, data.width, data.height);
1725
1728
  canvas.restore();
1726
1729
  return true;
1727
1730
  }
@@ -1731,7 +1734,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
1731
1734
  }
1732
1735
  else {
1733
1736
  if (!paint.patternTask) {
1734
- paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this, undefined, undefined, function* () {
1737
+ paint.patternTask = core.ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
1735
1738
  paint.patternTask = null;
1736
1739
  if (canvas.bounds.hit(ui.__nowWorld))
1737
1740
  createPattern(ui, paint, pixelRatio);