@leafer-ui/miniapp 1.6.3 → 1.6.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.
@@ -2269,16 +2269,19 @@ class LeaferCanvasBase extends Canvas$1 {
2269
2269
  if (blendMode)
2270
2270
  this.blendMode = 'source-over';
2271
2271
  }
2272
- clearWorld(bounds, ceilPixel) {
2273
- this.setTempBounds(bounds, ceilPixel);
2274
- this.clearRect(tempBounds$1.x, tempBounds$1.y, tempBounds$1.width, tempBounds$1.height);
2275
- }
2276
2272
  clipWorld(bounds, ceilPixel) {
2277
2273
  this.beginPath();
2278
2274
  this.setTempBounds(bounds, ceilPixel);
2279
2275
  this.rect(tempBounds$1.x, tempBounds$1.y, tempBounds$1.width, tempBounds$1.height);
2280
2276
  this.clip();
2281
2277
  }
2278
+ clipUI(ruleData) {
2279
+ ruleData.windingRule ? this.clip(ruleData.windingRule) : this.clip();
2280
+ }
2281
+ clearWorld(bounds, ceilPixel) {
2282
+ this.setTempBounds(bounds, ceilPixel);
2283
+ this.clearRect(tempBounds$1.x, tempBounds$1.y, tempBounds$1.width, tempBounds$1.height);
2284
+ }
2282
2285
  clear() {
2283
2286
  const { pixelRatio } = this;
2284
2287
  this.clearRect(0, 0, this.width * pixelRatio + 2, this.height * pixelRatio + 2);
@@ -5447,7 +5450,7 @@ const LeafRender = {
5447
5450
  if (this.__worldOpacity) {
5448
5451
  canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
5449
5452
  this.__drawRenderPath(canvas);
5450
- this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
5453
+ canvas.clipUI(this);
5451
5454
  }
5452
5455
  },
5453
5456
  __updateWorldOpacity() {
@@ -6230,7 +6233,7 @@ class LeafLevelList {
6230
6233
  }
6231
6234
  }
6232
6235
 
6233
- const version = "1.6.3";
6236
+ const version = "1.6.4";
6234
6237
 
6235
6238
  class LeaferCanvas extends LeaferCanvasBase {
6236
6239
  get allowBackgroundColor() { return false; }
@@ -7665,7 +7668,7 @@ const UIRender = {
7665
7668
  __drawAfterFill(canvas, options) {
7666
7669
  if (this.__.__clipAfterFill) {
7667
7670
  canvas.save();
7668
- this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
7671
+ canvas.clipUI();
7669
7672
  this.__drawContent(canvas, options);
7670
7673
  canvas.restore();
7671
7674
  }
@@ -9150,6 +9153,9 @@ __decorate([
9150
9153
  __decorate([
9151
9154
  boundsType('show')
9152
9155
  ], Text.prototype, "textOverflow", void 0);
9156
+ __decorate([
9157
+ surfaceType(false)
9158
+ ], Text.prototype, "textEditing", void 0);
9153
9159
  Text = __decorate([
9154
9160
  registerUI()
9155
9161
  ], Text);
@@ -10719,11 +10725,14 @@ function drawAlign(stroke, align, ui, canvas) {
10719
10725
  out.blendMode = align === 'outside' ? 'destination-out' : 'destination-in';
10720
10726
  fillText(ui, out);
10721
10727
  out.blendMode = 'normal';
10728
+ copyWorld(canvas, out, ui);
10729
+ out.recycle(ui.__nowWorld);
10730
+ }
10731
+ function copyWorld(canvas, out, ui) {
10722
10732
  if (ui.__worldFlipped || Platform.fullImageShadow)
10723
10733
  canvas.copyWorldByReset(out, ui.__nowWorld);
10724
10734
  else
10725
10735
  canvas.copyWorldToInner(out, ui.__nowWorld, ui.__layout.renderBounds);
10726
- out.recycle(ui.__nowWorld);
10727
10736
  }
10728
10737
  function drawTextStroke(ui, canvas) {
10729
10738
  let row, data = ui.__.__textDrawData;
@@ -10792,9 +10801,8 @@ function drawCenter(stroke, strokeWidthScale, ui, canvas) {
10792
10801
  Paint.strokeArrow(stroke, ui, canvas);
10793
10802
  }
10794
10803
  function drawInside(stroke, ui, canvas) {
10795
- const data = ui.__;
10796
10804
  canvas.save();
10797
- data.windingRule ? canvas.clip(data.windingRule) : canvas.clip();
10805
+ canvas.clipUI(ui);
10798
10806
  drawCenter(stroke, 2, ui, canvas);
10799
10807
  canvas.restore();
10800
10808
  }
@@ -10808,12 +10816,9 @@ function drawOutside(stroke, ui, canvas) {
10808
10816
  const out = canvas.getSameCanvas(true, true);
10809
10817
  ui.__drawRenderPath(out);
10810
10818
  drawCenter(stroke, 2, ui, out);
10811
- data.windingRule ? out.clip(data.windingRule) : out.clip();
10819
+ out.clipUI(data);
10812
10820
  out.clearWorld(renderBounds);
10813
- if (ui.__worldFlipped || Platform.fullImageShadow)
10814
- canvas.copyWorldByReset(out, ui.__nowWorld);
10815
- else
10816
- canvas.copyWorldToInner(out, ui.__nowWorld, renderBounds);
10821
+ copyWorld(canvas, out, ui);
10817
10822
  out.recycle(ui.__nowWorld);
10818
10823
  }
10819
10824
  }
@@ -10869,9 +10874,7 @@ function compute(attrName, ui) {
10869
10874
  paints = [paints];
10870
10875
  recycleMap = PaintImage.recycleImage(attrName, data);
10871
10876
  for (let i = 0, len = paints.length, item; i < len; i++) {
10872
- item = getLeafPaint(attrName, paints[i], ui);
10873
- if (item)
10874
- leafPaints.push(item);
10877
+ (item = getLeafPaint(attrName, paints[i], ui)) && leafPaints.push(item);
10875
10878
  }
10876
10879
  data['_' + attrName] = leafPaints.length ? leafPaints : undefined;
10877
10880
  if (leafPaints.length) {
@@ -10909,8 +10912,8 @@ function getLeafPaint(attrName, paint, ui) {
10909
10912
  data = PaintGradient.conicGradient(paint, boxBounds);
10910
10913
  break;
10911
10914
  case 'solid':
10912
- const { type, blendMode, color, opacity } = paint;
10913
- data = { type, blendMode, style: ColorConvert.string(color, opacity) };
10915
+ const { type, color, opacity } = paint;
10916
+ data = { type, style: ColorConvert.string(color, opacity) };
10914
10917
  break;
10915
10918
  default:
10916
10919
  if (paint.r !== undefined)
@@ -11287,7 +11290,7 @@ function checkImage(ui, canvas, paint, allowDraw) {
11287
11290
  }
11288
11291
  function drawImage(ui, canvas, paint, data) {
11289
11292
  canvas.save();
11290
- ui.windingRule ? canvas.clip(ui.windingRule) : canvas.clip();
11293
+ canvas.clipUI(ui);
11291
11294
  if (paint.blendMode)
11292
11295
  canvas.blendMode = paint.blendMode;
11293
11296
  if (data.opacity)
@@ -11452,12 +11455,10 @@ function shadow(ui, current, shape) {
11452
11455
  }
11453
11456
  worldCanvas ? other.copyWorld(worldCanvas, nowWorld, nowWorld, 'destination-out') : other.copyWorld(shape.canvas, shapeBounds, bounds, 'destination-out');
11454
11457
  }
11455
- if (ui.__worldFlipped) {
11458
+ if (ui.__worldFlipped)
11456
11459
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
11457
- }
11458
- else {
11460
+ else
11459
11461
  current.copyWorldToInner(other, copyBounds, __layout.renderBounds, item.blendMode);
11460
- }
11461
11462
  if (end && index < end)
11462
11463
  other.clearWorld(copyBounds, true);
11463
11464
  });
@@ -11516,12 +11517,10 @@ function innerShadow(ui, current, shape) {
11516
11517
  copyBounds = bounds;
11517
11518
  }
11518
11519
  other.fillWorld(copyBounds, ColorConvert.string(item.color), 'source-in');
11519
- if (ui.__worldFlipped) {
11520
+ if (ui.__worldFlipped)
11520
11521
  current.copyWorldByReset(other, copyBounds, nowWorld, item.blendMode);
11521
- }
11522
- else {
11522
+ else
11523
11523
  current.copyWorldToInner(other, copyBounds, __layout.renderBounds, item.blendMode);
11524
- }
11525
11524
  if (end && index < end)
11526
11525
  other.clearWorld(copyBounds, true);
11527
11526
  });