leafer-ui 1.0.5 → 1.0.6

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/web.js CHANGED
@@ -555,6 +555,12 @@ var LeaferUI = (function (exports) {
555
555
  to.y = t.y + sin$4(r) * distance;
556
556
  return to;
557
557
  },
558
+ toNumberPoints(originPoints) {
559
+ let points = originPoints;
560
+ if (typeof originPoints[0] === 'object')
561
+ points = [], originPoints.forEach(p => points.push(p.x, p.y));
562
+ return points;
563
+ },
558
564
  reset(t) {
559
565
  P$5.reset(t);
560
566
  }
@@ -1545,7 +1551,10 @@ var LeaferUI = (function (exports) {
1545
1551
 
1546
1552
  class LeafData {
1547
1553
  get __useNaturalRatio() { return true; }
1548
- get __isLinePath() { return this.path && this.path.length === 6; }
1554
+ get __isLinePath() {
1555
+ const { path } = this;
1556
+ return path && path.length === 6 && path[0] === 1;
1557
+ }
1549
1558
  get __blendMode() {
1550
1559
  if (this.eraser && this.eraser !== 'path')
1551
1560
  return 'destination-out';
@@ -2308,11 +2317,12 @@ var LeaferUI = (function (exports) {
2308
2317
 
2309
2318
  const { sin: sin$3, cos: cos$3, atan2: atan2$1, ceil: ceil$1, abs: abs$3, PI: PI$2, sqrt: sqrt$1, pow } = Math;
2310
2319
  const { setPoint: setPoint$2, addPoint: addPoint$2 } = TwoPointBoundsHelper;
2311
- const { set } = PointHelper;
2320
+ const { set, toNumberPoints } = PointHelper;
2312
2321
  const { M: M$5, L: L$6, C: C$5, Q: Q$4, Z: Z$5 } = PathCommandMap;
2313
2322
  const tempPoint$2 = {};
2314
2323
  const BezierHelper = {
2315
- points(data, points, curve, close) {
2324
+ points(data, originPoints, curve, close) {
2325
+ let points = toNumberPoints(originPoints);
2316
2326
  data.push(M$5, points[0], points[1]);
2317
2327
  if (curve && points.length > 5) {
2318
2328
  let aX, aY, bX, bY, cX, cY, c1X, c1Y, c2X, c2Y;
@@ -2821,6 +2831,27 @@ var LeaferUI = (function (exports) {
2821
2831
  }
2822
2832
  return data;
2823
2833
  },
2834
+ objectToCanvasData(list) {
2835
+ const data = [];
2836
+ list.forEach(item => {
2837
+ switch (item.name) {
2838
+ case 'M':
2839
+ data.push(M$4, item.x, item.y);
2840
+ break;
2841
+ case 'L':
2842
+ data.push(L$5, item.x, item.y);
2843
+ break;
2844
+ case 'C':
2845
+ data.push(C$4, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
2846
+ break;
2847
+ case 'Q':
2848
+ data.push(Q$3, item.x1, item.y1, item.x, item.y);
2849
+ break;
2850
+ case 'Z': data.push(Z$4);
2851
+ }
2852
+ });
2853
+ return data;
2854
+ },
2824
2855
  copyData(data, old, index, count) {
2825
2856
  for (let i = index, end = index + count; i < end; i++) {
2826
2857
  data.push(old[i]);
@@ -5162,7 +5193,7 @@ var LeaferUI = (function (exports) {
5162
5193
  if (this.__worldOpacity) {
5163
5194
  canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
5164
5195
  this.__drawRenderPath(canvas);
5165
- this.__.windingRule ? canvas.clip(this.__.windingRule) : canvas.clip();
5196
+ this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
5166
5197
  }
5167
5198
  },
5168
5199
  __updateWorldOpacity() {
@@ -5679,11 +5710,17 @@ var LeaferUI = (function (exports) {
5679
5710
  add(child, index) {
5680
5711
  if (child === this)
5681
5712
  return;
5682
- child.__ || (child = UICreator.get(child.tag, child));
5713
+ const noIndex = index === undefined;
5714
+ if (!child.__) {
5715
+ if (child instanceof Array)
5716
+ return child.forEach(item => { this.add(item, index); noIndex || index++; });
5717
+ else
5718
+ child = UICreator.get(child.tag, child);
5719
+ }
5683
5720
  if (child.parent)
5684
5721
  child.parent.remove(child);
5685
5722
  child.parent = this;
5686
- index === undefined ? this.children.push(child) : this.children.splice(index, 0, child);
5723
+ noIndex ? this.children.push(child) : this.children.splice(index, 0, child);
5687
5724
  if (child.isBranch)
5688
5725
  this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
5689
5726
  child.__layout.boxChanged || child.__layout.boxChange();
@@ -5697,9 +5734,7 @@ var LeaferUI = (function (exports) {
5697
5734
  }
5698
5735
  this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
5699
5736
  }
5700
- addMany(...children) {
5701
- children.forEach(child => this.add(child));
5702
- }
5737
+ addMany(...children) { this.add(children); }
5703
5738
  remove(child, destroy) {
5704
5739
  if (child) {
5705
5740
  if (child.__) {
@@ -5927,7 +5962,7 @@ var LeaferUI = (function (exports) {
5927
5962
  }
5928
5963
  }
5929
5964
 
5930
- const version = "1.0.5";
5965
+ const version = "1.0.6";
5931
5966
 
5932
5967
  const debug$7 = Debug.get('LeaferCanvas');
5933
5968
  class LeaferCanvas extends LeaferCanvasBase {
@@ -6085,7 +6120,7 @@ var LeaferUI = (function (exports) {
6085
6120
  const oldSize = {};
6086
6121
  DataHelper.copyAttrs(oldSize, this, canvasSizeAttrs);
6087
6122
  this.resize(size);
6088
- if (this.width !== undefined)
6123
+ if (this.resizeListener && this.width !== undefined)
6089
6124
  this.resizeListener(new ResizeEvent(size, oldSize));
6090
6125
  }
6091
6126
  unrealCanvas() {
@@ -7080,6 +7115,13 @@ var LeaferUI = (function (exports) {
7080
7115
 
7081
7116
  const TextConvert = {};
7082
7117
  const ColorConvert = {};
7118
+ const UnitConvert = {
7119
+ number(value, percentRefer) {
7120
+ if (typeof value === 'object')
7121
+ return value.type === 'percent' ? value.value * percentRefer : value.value;
7122
+ return value;
7123
+ }
7124
+ };
7083
7125
  const PathArrow = {};
7084
7126
  const Paint = {};
7085
7127
  const PaintImage = {};
@@ -7100,7 +7142,7 @@ var LeaferUI = (function (exports) {
7100
7142
  }
7101
7143
  };
7102
7144
 
7103
- const { parse } = PathConvert;
7145
+ const { parse, objectToCanvasData } = PathConvert;
7104
7146
  const emptyPaint = {};
7105
7147
  const debug$4 = Debug.get('UIData');
7106
7148
  class UIData extends LeafData {
@@ -7114,10 +7156,11 @@ var LeaferUI = (function (exports) {
7114
7156
  scaleX = -scaleX;
7115
7157
  return scaleX > 1 ? strokeWidth / scaleX : strokeWidth;
7116
7158
  }
7117
- else {
7159
+ else
7118
7160
  return strokeWidth;
7119
- }
7120
7161
  }
7162
+ get __hasStroke() { return this.stroke && this.strokeWidth; }
7163
+ get __clipAfterFill() { return (this.cornerRadius || this.__pathInputed); }
7121
7164
  get __autoWidth() { return !this._width; }
7122
7165
  get __autoHeight() { return !this._height; }
7123
7166
  get __autoSide() { return !this._width || !this._height; }
@@ -7134,9 +7177,8 @@ var LeaferUI = (function (exports) {
7134
7177
  this.__leaf.scaleX *= -1;
7135
7178
  debug$4.warn('width < 0, instead -scaleX ', this);
7136
7179
  }
7137
- else {
7180
+ else
7138
7181
  this._width = value;
7139
- }
7140
7182
  }
7141
7183
  setHeight(value) {
7142
7184
  if (value < 0) {
@@ -7144,9 +7186,8 @@ var LeaferUI = (function (exports) {
7144
7186
  this.__leaf.scaleY *= -1;
7145
7187
  debug$4.warn('height < 0, instead -scaleY', this);
7146
7188
  }
7147
- else {
7189
+ else
7148
7190
  this._height = value;
7149
- }
7150
7191
  }
7151
7192
  setFill(value) {
7152
7193
  if (this.__naturalWidth)
@@ -7187,9 +7228,10 @@ var LeaferUI = (function (exports) {
7187
7228
  }
7188
7229
  }
7189
7230
  setPath(value) {
7190
- if (typeof value === 'string') {
7231
+ const isString = typeof value === 'string';
7232
+ if (isString || (value && typeof value[0] === 'object')) {
7191
7233
  this.__setInput('path', value);
7192
- this._path = parse(value);
7234
+ this._path = isString ? parse(value) : objectToCanvasData(value);
7193
7235
  }
7194
7236
  else {
7195
7237
  if (this.__input)
@@ -7204,12 +7246,8 @@ var LeaferUI = (function (exports) {
7204
7246
  value = value.filter((item) => item.visible !== false);
7205
7247
  this._shadow = value.length ? value : null;
7206
7248
  }
7207
- else if (value) {
7208
- this._shadow = value.visible === false ? null : [value];
7209
- }
7210
- else {
7211
- this._shadow = null;
7212
- }
7249
+ else
7250
+ this._shadow = value && value.visible !== false ? [value] : null;
7213
7251
  }
7214
7252
  setInnerShadow(value) {
7215
7253
  this.__setInput('innerShadow', value);
@@ -7218,12 +7256,8 @@ var LeaferUI = (function (exports) {
7218
7256
  value = value.filter((item) => item.visible !== false);
7219
7257
  this._innerShadow = value.length ? value : null;
7220
7258
  }
7221
- else if (value) {
7222
- this._innerShadow = value.visible === false ? null : [value];
7223
- }
7224
- else {
7225
- this._innerShadow = null;
7226
- }
7259
+ else
7260
+ this._innerShadow = value && value.visible !== false ? [value] : null;
7227
7261
  }
7228
7262
  __computePaint() {
7229
7263
  const { fill, stroke } = this.__input;
@@ -7234,24 +7268,19 @@ var LeaferUI = (function (exports) {
7234
7268
  this.__needComputePaint = false;
7235
7269
  }
7236
7270
  }
7237
- const UnitConvert = {
7238
- number(value, percentRefer) {
7239
- if (typeof value === 'object')
7240
- return value.type === 'percent' ? value.value * percentRefer : value.value;
7241
- return value;
7242
- }
7243
- };
7244
7271
 
7245
7272
  class GroupData extends UIData {
7246
7273
  }
7247
7274
 
7248
7275
  class BoxData extends GroupData {
7249
7276
  get __boxStroke() { return !this.__pathInputed; }
7277
+ get __drawAfterFill() { return this.overflow === 'hide' && this.__clipAfterFill && this.__leaf.children.length; }
7278
+ get __clipAfterFill() { return this.__leaf.isOverflow || super.__clipAfterFill; }
7250
7279
  }
7251
7280
 
7252
7281
  class LeaferData extends GroupData {
7253
- __getInputData() {
7254
- const data = super.__getInputData();
7282
+ __getInputData(names, options) {
7283
+ const data = super.__getInputData(names, options);
7255
7284
  canvasSizeAttrs.forEach(key => delete data[key]);
7256
7285
  return data;
7257
7286
  }
@@ -7278,6 +7307,7 @@ var LeaferUI = (function (exports) {
7278
7307
  }
7279
7308
 
7280
7309
  class PathData extends UIData {
7310
+ get __pathInputed() { return 2; }
7281
7311
  }
7282
7312
 
7283
7313
  class PenData extends GroupData {
@@ -7324,16 +7354,18 @@ var LeaferUI = (function (exports) {
7324
7354
  delete data.fill;
7325
7355
  return data;
7326
7356
  }
7327
- __getInputData() {
7328
- const data = super.__getInputData();
7357
+ __getInputData(names, options) {
7358
+ const data = super.__getInputData(names, options);
7329
7359
  delete data.fill;
7330
7360
  return data;
7331
7361
  }
7332
7362
  }
7333
7363
 
7334
7364
  class CanvasData extends RectData {
7335
- __getInputData() {
7336
- const data = super.__getInputData();
7365
+ get __isCanvas() { return true; }
7366
+ get __drawAfterFill() { return true; }
7367
+ __getInputData(names, options) {
7368
+ const data = super.__getInputData(names, options);
7337
7369
  data.url = this.__leaf.canvas.toDataURL('image/png');
7338
7370
  return data;
7339
7371
  }
@@ -7360,16 +7392,12 @@ var LeaferUI = (function (exports) {
7360
7392
  let width = 0;
7361
7393
  const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7362
7394
  if (shadow)
7363
- shadow.forEach(item => {
7364
- width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5);
7365
- });
7395
+ shadow.forEach(item => width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5));
7366
7396
  if (blur)
7367
7397
  width = Math.max(width, blur);
7368
7398
  let shapeWidth = width = Math.ceil(width);
7369
7399
  if (innerShadow)
7370
- innerShadow.forEach(item => {
7371
- shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5);
7372
- });
7400
+ innerShadow.forEach(item => shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5));
7373
7401
  if (backgroundBlur)
7374
7402
  shapeWidth = Math.max(shapeWidth, backgroundBlur);
7375
7403
  this.__layout.renderShapeSpread = shapeWidth;
@@ -7451,6 +7479,16 @@ var LeaferUI = (function (exports) {
7451
7479
  if (stroke && !ignoreStroke)
7452
7480
  this.__.__pixelStroke ? Paint.strokes(stroke, this, canvas) : Paint.stroke('#000000', this, canvas);
7453
7481
  }
7482
+ },
7483
+ __drawAfterFill(canvas, options) {
7484
+ if (this.__.__clipAfterFill) {
7485
+ canvas.save();
7486
+ this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
7487
+ this.__drawContent(canvas, options);
7488
+ canvas.restore();
7489
+ }
7490
+ else
7491
+ this.__drawContent(canvas, options);
7454
7492
  }
7455
7493
  };
7456
7494
  function drawFast(ui, canvas, options) {
@@ -7517,8 +7555,8 @@ var LeaferUI = (function (exports) {
7517
7555
  return pen;
7518
7556
  }
7519
7557
  get editConfig() { return undefined; }
7520
- get editOuter() { return this.__.__isLinePath ? 'LineEditTool' : 'EditTool'; }
7521
- get editInner() { return 'PathEditor'; }
7558
+ get editOuter() { return ''; }
7559
+ get editInner() { return ''; }
7522
7560
  constructor(data) {
7523
7561
  super(data);
7524
7562
  }
@@ -7529,9 +7567,8 @@ var LeaferUI = (function (exports) {
7529
7567
  Object.assign(this, data);
7530
7568
  this.lockNormalStyle = false;
7531
7569
  }
7532
- else {
7570
+ else
7533
7571
  Object.assign(this, data);
7534
- }
7535
7572
  }
7536
7573
  get(name) {
7537
7574
  return typeof name === 'string' ? this.__.__getInput(name) : this.__.__getInputData(name);
@@ -7833,23 +7870,13 @@ var LeaferUI = (function (exports) {
7833
7870
  if (data.children) {
7834
7871
  const { children } = data;
7835
7872
  delete data.children;
7836
- if (!this.children) {
7837
- this.__setBranch();
7838
- }
7839
- else {
7840
- this.clear();
7841
- }
7873
+ this.children ? this.clear() : this.__setBranch();
7842
7874
  super.set(data, isTemp);
7843
- let child;
7844
- children.forEach(childData => {
7845
- child = childData.__ ? childData : UICreator.get(childData.tag, childData);
7846
- this.add(child);
7847
- });
7875
+ children.forEach(child => this.add(child));
7848
7876
  data.children = children;
7849
7877
  }
7850
- else {
7878
+ else
7851
7879
  super.set(data, isTemp);
7852
- }
7853
7880
  }
7854
7881
  toJSON(options) {
7855
7882
  const data = super.toJSON(options);
@@ -8281,9 +8308,7 @@ var LeaferUI = (function (exports) {
8281
8308
  }
8282
8309
  __updateStrokeSpread() { return 0; }
8283
8310
  __updateRectRenderSpread() { return 0; }
8284
- __updateRenderSpread() {
8285
- return this.__updateRectRenderSpread() || -1;
8286
- }
8311
+ __updateRenderSpread() { return this.__updateRectRenderSpread() || -1; }
8287
8312
  __updateRectBoxBounds() { }
8288
8313
  __updateBoxBounds(_secondLayout) {
8289
8314
  const data = this.__;
@@ -8303,13 +8328,11 @@ var LeaferUI = (function (exports) {
8303
8328
  }
8304
8329
  this.__updateNaturalSize();
8305
8330
  }
8306
- else {
8331
+ else
8307
8332
  this.__updateRectBoxBounds();
8308
- }
8309
8333
  }
8310
- else {
8334
+ else
8311
8335
  this.__updateRectBoxBounds();
8312
- }
8313
8336
  }
8314
8337
  __updateStrokeBounds() { }
8315
8338
  __updateRenderBounds() {
@@ -8319,14 +8342,13 @@ var LeaferUI = (function (exports) {
8319
8342
  super.__updateRenderBounds();
8320
8343
  copy$3(childrenRenderBounds, renderBounds);
8321
8344
  this.__updateRectRenderBounds();
8322
- isOverflow = !includes$1(renderBounds, childrenRenderBounds) || !this.pathInputed || !this.__.cornerRadius;
8345
+ isOverflow = !includes$1(renderBounds, childrenRenderBounds);
8346
+ if (isOverflow && this.__.overflow !== 'hide')
8347
+ add(renderBounds, childrenRenderBounds);
8323
8348
  }
8324
- else {
8349
+ else
8325
8350
  this.__updateRectRenderBounds();
8326
- }
8327
- this.isOverflow !== isOverflow && (this.isOverflow = isOverflow);
8328
- if (!(this.__.__drawAfterFill = this.__.overflow === 'hide') && isOverflow)
8329
- add(renderBounds, childrenRenderBounds);
8351
+ !this.isOverflow !== !isOverflow && (this.isOverflow = isOverflow);
8330
8352
  }
8331
8353
  __updateRectRenderBounds() { }
8332
8354
  __updateRectChange() { }
@@ -8346,20 +8368,9 @@ var LeaferUI = (function (exports) {
8346
8368
  this.__renderGroup(canvas, options);
8347
8369
  }
8348
8370
  }
8349
- __drawAfterFill(canvas, options) {
8350
- const { length } = this.children;
8351
- if (this.isOverflow) {
8352
- canvas.save();
8353
- canvas.clip();
8354
- if (length)
8355
- this.__renderGroup(canvas, options);
8356
- canvas.restore();
8357
- }
8358
- else {
8359
- if (length)
8360
- this.__renderGroup(canvas, options);
8361
- }
8362
- if (this.__.stroke && length) {
8371
+ __drawContent(canvas, options) {
8372
+ this.__renderGroup(canvas, options);
8373
+ if (this.__.__hasStroke) {
8363
8374
  canvas.setWorld(this.__nowWorld);
8364
8375
  this.__drawRenderPath(canvas);
8365
8376
  }
@@ -8523,17 +8534,15 @@ var LeaferUI = (function (exports) {
8523
8534
  if (data.__useArrow)
8524
8535
  PathArrow.addArrows(this, false);
8525
8536
  }
8526
- else {
8537
+ else
8527
8538
  super.__updateRenderPath();
8528
- }
8529
8539
  }
8530
8540
  __updateBoxBounds() {
8531
8541
  if (this.points) {
8532
8542
  toBounds$1(this.__.__pathForRender, this.__layout.boxBounds);
8533
8543
  }
8534
- else {
8544
+ else
8535
8545
  super.__updateBoxBounds();
8536
- }
8537
8546
  }
8538
8547
  };
8539
8548
  __decorate([
@@ -8671,7 +8680,6 @@ var LeaferUI = (function (exports) {
8671
8680
  super(data);
8672
8681
  this.canvas = Creator.canvas(this.__);
8673
8682
  this.context = this.canvas.context;
8674
- this.__.__isCanvas = this.__.__drawAfterFill = true;
8675
8683
  if (data && data.url)
8676
8684
  this.drawImage(data.url);
8677
8685
  }
@@ -8684,8 +8692,7 @@ var LeaferUI = (function (exports) {
8684
8692
  });
8685
8693
  }
8686
8694
  draw(ui, offset, scale, rotation) {
8687
- ui.__layout.update();
8688
- const matrix = new Matrix(ui.__world).invert();
8695
+ const matrix = new Matrix(ui.worldTransform).invert();
8689
8696
  const m = new Matrix();
8690
8697
  if (offset)
8691
8698
  m.translate(offset.x, offset.y);
@@ -8700,17 +8707,9 @@ var LeaferUI = (function (exports) {
8700
8707
  paint() {
8701
8708
  this.forceRender();
8702
8709
  }
8703
- __drawAfterFill(canvas, _options) {
8704
- const { width, height, cornerRadius } = this.__, { view } = this.canvas;
8705
- if (cornerRadius || this.pathInputed) {
8706
- canvas.save();
8707
- canvas.clip();
8708
- canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
8709
- canvas.restore();
8710
- }
8711
- else {
8712
- canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
8713
- }
8710
+ __drawContent(canvas, _options) {
8711
+ const { width, height } = this.__, { view } = this.canvas;
8712
+ canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
8714
8713
  }
8715
8714
  __updateSize() {
8716
8715
  const { canvas } = this;
@@ -8754,7 +8753,6 @@ var LeaferUI = (function (exports) {
8754
8753
  const { copyAndSpread, includes, isSame: isSame$1, spread, setList } = BoundsHelper;
8755
8754
  exports.Text = class Text extends exports.UI {
8756
8755
  get __tag() { return 'Text'; }
8757
- get editInner() { return 'TextEditor'; }
8758
8756
  get textDrawData() {
8759
8757
  this.__layout.update();
8760
8758
  return this.__.__textDrawData;
@@ -8920,7 +8918,6 @@ var LeaferUI = (function (exports) {
8920
8918
  get __tag() { return 'Path'; }
8921
8919
  constructor(data) {
8922
8920
  super(data);
8923
- this.__.__pathInputed = 2;
8924
8921
  }
8925
8922
  };
8926
8923
  __decorate([
@@ -9003,21 +9000,17 @@ var LeaferUI = (function (exports) {
9003
9000
  this.tree = this.addLeafer(tree);
9004
9001
  if (sky || editor)
9005
9002
  this.sky = this.addLeafer(sky || { type: 'draw', usePartRender: false });
9006
- if (editor) {
9007
- this.editor = Creator.editor(editor);
9008
- this.sky.add(this.editor);
9009
- }
9003
+ if (editor)
9004
+ this.sky.add(this.editor = Creator.editor(editor));
9010
9005
  }
9011
9006
  }
9012
9007
  __setApp() {
9013
9008
  const { canvas } = this;
9014
9009
  const { realCanvas, view } = this.config;
9015
- if (realCanvas || view === this.canvas.view || !canvas.parentView) {
9010
+ if (realCanvas || view === this.canvas.view || !canvas.parentView)
9016
9011
  this.realCanvas = true;
9017
- }
9018
- else {
9012
+ else
9019
9013
  canvas.unrealCanvas();
9020
- }
9021
9014
  this.leafer = this;
9022
9015
  this.watcher.disable();
9023
9016
  this.layouter.disable();
@@ -9423,10 +9416,7 @@ var LeaferUI = (function (exports) {
9423
9416
  leafer.getValidMove = function (moveX, moveY) {
9424
9417
  const { scroll, disabled } = this.app.config.move;
9425
9418
  if (scroll) {
9426
- if (Math.abs(moveX) > Math.abs(moveY))
9427
- moveY = 0;
9428
- else
9429
- moveX = 0;
9419
+ Math.abs(moveX) > Math.abs(moveY) ? moveY = 0 : moveX = 0;
9430
9420
  if (scroll === 'limit') {
9431
9421
  const { x, y, width, height } = new Bounds(this.__world).addPoint(this.zoomLayer);
9432
9422
  const right = x + width - this.width, bottom = y + height - this.height;
@@ -11510,7 +11500,7 @@ var LeaferUI = (function (exports) {
11510
11500
  }
11511
11501
  if (allowPaint) {
11512
11502
  canvas.save();
11513
- canvas.clip();
11503
+ ui.windingRule ? canvas.clip(ui.windingRule) : canvas.clip();
11514
11504
  if (paint.blendMode)
11515
11505
  canvas.blendMode = paint.blendMode;
11516
11506
  if (data.opacity)