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.
@@ -552,6 +552,12 @@ const PointHelper = {
552
552
  to.y = t.y + sin$4(r) * distance;
553
553
  return to;
554
554
  },
555
+ toNumberPoints(originPoints) {
556
+ let points = originPoints;
557
+ if (typeof originPoints[0] === 'object')
558
+ points = [], originPoints.forEach(p => points.push(p.x, p.y));
559
+ return points;
560
+ },
555
561
  reset(t) {
556
562
  P$5.reset(t);
557
563
  }
@@ -1542,7 +1548,10 @@ const { assign } = DataHelper;
1542
1548
 
1543
1549
  class LeafData {
1544
1550
  get __useNaturalRatio() { return true; }
1545
- get __isLinePath() { return this.path && this.path.length === 6; }
1551
+ get __isLinePath() {
1552
+ const { path } = this;
1553
+ return path && path.length === 6 && path[0] === 1;
1554
+ }
1546
1555
  get __blendMode() {
1547
1556
  if (this.eraser && this.eraser !== 'path')
1548
1557
  return 'destination-out';
@@ -2305,11 +2314,12 @@ const RectHelper = {
2305
2314
 
2306
2315
  const { sin: sin$3, cos: cos$3, atan2: atan2$1, ceil: ceil$1, abs: abs$3, PI: PI$2, sqrt: sqrt$1, pow } = Math;
2307
2316
  const { setPoint: setPoint$2, addPoint: addPoint$2 } = TwoPointBoundsHelper;
2308
- const { set } = PointHelper;
2317
+ const { set, toNumberPoints } = PointHelper;
2309
2318
  const { M: M$5, L: L$6, C: C$5, Q: Q$4, Z: Z$5 } = PathCommandMap;
2310
2319
  const tempPoint$2 = {};
2311
2320
  const BezierHelper = {
2312
- points(data, points, curve, close) {
2321
+ points(data, originPoints, curve, close) {
2322
+ let points = toNumberPoints(originPoints);
2313
2323
  data.push(M$5, points[0], points[1]);
2314
2324
  if (curve && points.length > 5) {
2315
2325
  let aX, aY, bX, bY, cX, cY, c1X, c1Y, c2X, c2Y;
@@ -2818,6 +2828,27 @@ const PathConvert = {
2818
2828
  }
2819
2829
  return data;
2820
2830
  },
2831
+ objectToCanvasData(list) {
2832
+ const data = [];
2833
+ list.forEach(item => {
2834
+ switch (item.name) {
2835
+ case 'M':
2836
+ data.push(M$4, item.x, item.y);
2837
+ break;
2838
+ case 'L':
2839
+ data.push(L$5, item.x, item.y);
2840
+ break;
2841
+ case 'C':
2842
+ data.push(C$4, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
2843
+ break;
2844
+ case 'Q':
2845
+ data.push(Q$3, item.x1, item.y1, item.x, item.y);
2846
+ break;
2847
+ case 'Z': data.push(Z$4);
2848
+ }
2849
+ });
2850
+ return data;
2851
+ },
2821
2852
  copyData(data, old, index, count) {
2822
2853
  for (let i = index, end = index + count; i < end; i++) {
2823
2854
  data.push(old[i]);
@@ -5159,7 +5190,7 @@ const LeafRender = {
5159
5190
  if (this.__worldOpacity) {
5160
5191
  canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
5161
5192
  this.__drawRenderPath(canvas);
5162
- this.__.windingRule ? canvas.clip(this.__.windingRule) : canvas.clip();
5193
+ this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
5163
5194
  }
5164
5195
  },
5165
5196
  __updateWorldOpacity() {
@@ -5676,11 +5707,17 @@ let Branch = class Branch extends Leaf {
5676
5707
  add(child, index) {
5677
5708
  if (child === this)
5678
5709
  return;
5679
- child.__ || (child = UICreator.get(child.tag, child));
5710
+ const noIndex = index === undefined;
5711
+ if (!child.__) {
5712
+ if (child instanceof Array)
5713
+ return child.forEach(item => { this.add(item, index); noIndex || index++; });
5714
+ else
5715
+ child = UICreator.get(child.tag, child);
5716
+ }
5680
5717
  if (child.parent)
5681
5718
  child.parent.remove(child);
5682
5719
  child.parent = this;
5683
- index === undefined ? this.children.push(child) : this.children.splice(index, 0, child);
5720
+ noIndex ? this.children.push(child) : this.children.splice(index, 0, child);
5684
5721
  if (child.isBranch)
5685
5722
  this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
5686
5723
  child.__layout.boxChanged || child.__layout.boxChange();
@@ -5694,9 +5731,7 @@ let Branch = class Branch extends Leaf {
5694
5731
  }
5695
5732
  this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
5696
5733
  }
5697
- addMany(...children) {
5698
- children.forEach(child => this.add(child));
5699
- }
5734
+ addMany(...children) { this.add(children); }
5700
5735
  remove(child, destroy) {
5701
5736
  if (child) {
5702
5737
  if (child.__) {
@@ -5924,7 +5959,7 @@ class LeafLevelList {
5924
5959
  }
5925
5960
  }
5926
5961
 
5927
- const version = "1.0.5";
5962
+ const version = "1.0.6";
5928
5963
 
5929
5964
  const debug$7 = Debug.get('LeaferCanvas');
5930
5965
  class LeaferCanvas extends LeaferCanvasBase {
@@ -6082,7 +6117,7 @@ class LeaferCanvas extends LeaferCanvasBase {
6082
6117
  const oldSize = {};
6083
6118
  DataHelper.copyAttrs(oldSize, this, canvasSizeAttrs);
6084
6119
  this.resize(size);
6085
- if (this.width !== undefined)
6120
+ if (this.resizeListener && this.width !== undefined)
6086
6121
  this.resizeListener(new ResizeEvent(size, oldSize));
6087
6122
  }
6088
6123
  unrealCanvas() {
@@ -7077,6 +7112,13 @@ function zoomLayerType() {
7077
7112
 
7078
7113
  const TextConvert = {};
7079
7114
  const ColorConvert = {};
7115
+ const UnitConvert = {
7116
+ number(value, percentRefer) {
7117
+ if (typeof value === 'object')
7118
+ return value.type === 'percent' ? value.value * percentRefer : value.value;
7119
+ return value;
7120
+ }
7121
+ };
7080
7122
  const PathArrow = {};
7081
7123
  const Paint = {};
7082
7124
  const PaintImage = {};
@@ -7097,7 +7139,7 @@ const Transition = {
7097
7139
  }
7098
7140
  };
7099
7141
 
7100
- const { parse } = PathConvert;
7142
+ const { parse, objectToCanvasData } = PathConvert;
7101
7143
  const emptyPaint = {};
7102
7144
  const debug$4 = Debug.get('UIData');
7103
7145
  class UIData extends LeafData {
@@ -7111,10 +7153,11 @@ class UIData extends LeafData {
7111
7153
  scaleX = -scaleX;
7112
7154
  return scaleX > 1 ? strokeWidth / scaleX : strokeWidth;
7113
7155
  }
7114
- else {
7156
+ else
7115
7157
  return strokeWidth;
7116
- }
7117
7158
  }
7159
+ get __hasStroke() { return this.stroke && this.strokeWidth; }
7160
+ get __clipAfterFill() { return (this.cornerRadius || this.__pathInputed); }
7118
7161
  get __autoWidth() { return !this._width; }
7119
7162
  get __autoHeight() { return !this._height; }
7120
7163
  get __autoSide() { return !this._width || !this._height; }
@@ -7131,9 +7174,8 @@ class UIData extends LeafData {
7131
7174
  this.__leaf.scaleX *= -1;
7132
7175
  debug$4.warn('width < 0, instead -scaleX ', this);
7133
7176
  }
7134
- else {
7177
+ else
7135
7178
  this._width = value;
7136
- }
7137
7179
  }
7138
7180
  setHeight(value) {
7139
7181
  if (value < 0) {
@@ -7141,9 +7183,8 @@ class UIData extends LeafData {
7141
7183
  this.__leaf.scaleY *= -1;
7142
7184
  debug$4.warn('height < 0, instead -scaleY', this);
7143
7185
  }
7144
- else {
7186
+ else
7145
7187
  this._height = value;
7146
- }
7147
7188
  }
7148
7189
  setFill(value) {
7149
7190
  if (this.__naturalWidth)
@@ -7184,9 +7225,10 @@ class UIData extends LeafData {
7184
7225
  }
7185
7226
  }
7186
7227
  setPath(value) {
7187
- if (typeof value === 'string') {
7228
+ const isString = typeof value === 'string';
7229
+ if (isString || (value && typeof value[0] === 'object')) {
7188
7230
  this.__setInput('path', value);
7189
- this._path = parse(value);
7231
+ this._path = isString ? parse(value) : objectToCanvasData(value);
7190
7232
  }
7191
7233
  else {
7192
7234
  if (this.__input)
@@ -7201,12 +7243,8 @@ class UIData extends LeafData {
7201
7243
  value = value.filter((item) => item.visible !== false);
7202
7244
  this._shadow = value.length ? value : null;
7203
7245
  }
7204
- else if (value) {
7205
- this._shadow = value.visible === false ? null : [value];
7206
- }
7207
- else {
7208
- this._shadow = null;
7209
- }
7246
+ else
7247
+ this._shadow = value && value.visible !== false ? [value] : null;
7210
7248
  }
7211
7249
  setInnerShadow(value) {
7212
7250
  this.__setInput('innerShadow', value);
@@ -7215,12 +7253,8 @@ class UIData extends LeafData {
7215
7253
  value = value.filter((item) => item.visible !== false);
7216
7254
  this._innerShadow = value.length ? value : null;
7217
7255
  }
7218
- else if (value) {
7219
- this._innerShadow = value.visible === false ? null : [value];
7220
- }
7221
- else {
7222
- this._innerShadow = null;
7223
- }
7256
+ else
7257
+ this._innerShadow = value && value.visible !== false ? [value] : null;
7224
7258
  }
7225
7259
  __computePaint() {
7226
7260
  const { fill, stroke } = this.__input;
@@ -7231,24 +7265,19 @@ class UIData extends LeafData {
7231
7265
  this.__needComputePaint = false;
7232
7266
  }
7233
7267
  }
7234
- const UnitConvert = {
7235
- number(value, percentRefer) {
7236
- if (typeof value === 'object')
7237
- return value.type === 'percent' ? value.value * percentRefer : value.value;
7238
- return value;
7239
- }
7240
- };
7241
7268
 
7242
7269
  class GroupData extends UIData {
7243
7270
  }
7244
7271
 
7245
7272
  class BoxData extends GroupData {
7246
7273
  get __boxStroke() { return !this.__pathInputed; }
7274
+ get __drawAfterFill() { return this.overflow === 'hide' && this.__clipAfterFill && this.__leaf.children.length; }
7275
+ get __clipAfterFill() { return this.__leaf.isOverflow || super.__clipAfterFill; }
7247
7276
  }
7248
7277
 
7249
7278
  class LeaferData extends GroupData {
7250
- __getInputData() {
7251
- const data = super.__getInputData();
7279
+ __getInputData(names, options) {
7280
+ const data = super.__getInputData(names, options);
7252
7281
  canvasSizeAttrs.forEach(key => delete data[key]);
7253
7282
  return data;
7254
7283
  }
@@ -7275,6 +7304,7 @@ class StarData extends UIData {
7275
7304
  }
7276
7305
 
7277
7306
  class PathData extends UIData {
7307
+ get __pathInputed() { return 2; }
7278
7308
  }
7279
7309
 
7280
7310
  class PenData extends GroupData {
@@ -7321,16 +7351,18 @@ class ImageData extends RectData {
7321
7351
  delete data.fill;
7322
7352
  return data;
7323
7353
  }
7324
- __getInputData() {
7325
- const data = super.__getInputData();
7354
+ __getInputData(names, options) {
7355
+ const data = super.__getInputData(names, options);
7326
7356
  delete data.fill;
7327
7357
  return data;
7328
7358
  }
7329
7359
  }
7330
7360
 
7331
7361
  class CanvasData extends RectData {
7332
- __getInputData() {
7333
- const data = super.__getInputData();
7362
+ get __isCanvas() { return true; }
7363
+ get __drawAfterFill() { return true; }
7364
+ __getInputData(names, options) {
7365
+ const data = super.__getInputData(names, options);
7334
7366
  data.url = this.__leaf.canvas.toDataURL('image/png');
7335
7367
  return data;
7336
7368
  }
@@ -7357,16 +7389,12 @@ const UIBounds = {
7357
7389
  let width = 0;
7358
7390
  const { shadow, innerShadow, blur, backgroundBlur } = this.__;
7359
7391
  if (shadow)
7360
- shadow.forEach(item => {
7361
- width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5);
7362
- });
7392
+ 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));
7363
7393
  if (blur)
7364
7394
  width = Math.max(width, blur);
7365
7395
  let shapeWidth = width = Math.ceil(width);
7366
7396
  if (innerShadow)
7367
- innerShadow.forEach(item => {
7368
- shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5);
7369
- });
7397
+ 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));
7370
7398
  if (backgroundBlur)
7371
7399
  shapeWidth = Math.max(shapeWidth, backgroundBlur);
7372
7400
  this.__layout.renderShapeSpread = shapeWidth;
@@ -7448,6 +7476,16 @@ const UIRender = {
7448
7476
  if (stroke && !ignoreStroke)
7449
7477
  this.__.__pixelStroke ? Paint.strokes(stroke, this, canvas) : Paint.stroke('#000000', this, canvas);
7450
7478
  }
7479
+ },
7480
+ __drawAfterFill(canvas, options) {
7481
+ if (this.__.__clipAfterFill) {
7482
+ canvas.save();
7483
+ this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
7484
+ this.__drawContent(canvas, options);
7485
+ canvas.restore();
7486
+ }
7487
+ else
7488
+ this.__drawContent(canvas, options);
7451
7489
  }
7452
7490
  };
7453
7491
  function drawFast(ui, canvas, options) {
@@ -7514,8 +7552,8 @@ let UI = UI_1 = class UI extends Leaf {
7514
7552
  return pen;
7515
7553
  }
7516
7554
  get editConfig() { return undefined; }
7517
- get editOuter() { return this.__.__isLinePath ? 'LineEditTool' : 'EditTool'; }
7518
- get editInner() { return 'PathEditor'; }
7555
+ get editOuter() { return ''; }
7556
+ get editInner() { return ''; }
7519
7557
  constructor(data) {
7520
7558
  super(data);
7521
7559
  }
@@ -7526,9 +7564,8 @@ let UI = UI_1 = class UI extends Leaf {
7526
7564
  Object.assign(this, data);
7527
7565
  this.lockNormalStyle = false;
7528
7566
  }
7529
- else {
7567
+ else
7530
7568
  Object.assign(this, data);
7531
- }
7532
7569
  }
7533
7570
  get(name) {
7534
7571
  return typeof name === 'string' ? this.__.__getInput(name) : this.__.__getInputData(name);
@@ -7830,23 +7867,13 @@ let Group = class Group extends UI {
7830
7867
  if (data.children) {
7831
7868
  const { children } = data;
7832
7869
  delete data.children;
7833
- if (!this.children) {
7834
- this.__setBranch();
7835
- }
7836
- else {
7837
- this.clear();
7838
- }
7870
+ this.children ? this.clear() : this.__setBranch();
7839
7871
  super.set(data, isTemp);
7840
- let child;
7841
- children.forEach(childData => {
7842
- child = childData.__ ? childData : UICreator.get(childData.tag, childData);
7843
- this.add(child);
7844
- });
7872
+ children.forEach(child => this.add(child));
7845
7873
  data.children = children;
7846
7874
  }
7847
- else {
7875
+ else
7848
7876
  super.set(data, isTemp);
7849
- }
7850
7877
  }
7851
7878
  toJSON(options) {
7852
7879
  const data = super.toJSON(options);
@@ -8278,9 +8305,7 @@ let Box = class Box extends Group {
8278
8305
  }
8279
8306
  __updateStrokeSpread() { return 0; }
8280
8307
  __updateRectRenderSpread() { return 0; }
8281
- __updateRenderSpread() {
8282
- return this.__updateRectRenderSpread() || -1;
8283
- }
8308
+ __updateRenderSpread() { return this.__updateRectRenderSpread() || -1; }
8284
8309
  __updateRectBoxBounds() { }
8285
8310
  __updateBoxBounds(_secondLayout) {
8286
8311
  const data = this.__;
@@ -8300,13 +8325,11 @@ let Box = class Box extends Group {
8300
8325
  }
8301
8326
  this.__updateNaturalSize();
8302
8327
  }
8303
- else {
8328
+ else
8304
8329
  this.__updateRectBoxBounds();
8305
- }
8306
8330
  }
8307
- else {
8331
+ else
8308
8332
  this.__updateRectBoxBounds();
8309
- }
8310
8333
  }
8311
8334
  __updateStrokeBounds() { }
8312
8335
  __updateRenderBounds() {
@@ -8316,14 +8339,13 @@ let Box = class Box extends Group {
8316
8339
  super.__updateRenderBounds();
8317
8340
  copy$3(childrenRenderBounds, renderBounds);
8318
8341
  this.__updateRectRenderBounds();
8319
- isOverflow = !includes$1(renderBounds, childrenRenderBounds) || !this.pathInputed || !this.__.cornerRadius;
8342
+ isOverflow = !includes$1(renderBounds, childrenRenderBounds);
8343
+ if (isOverflow && this.__.overflow !== 'hide')
8344
+ add(renderBounds, childrenRenderBounds);
8320
8345
  }
8321
- else {
8346
+ else
8322
8347
  this.__updateRectRenderBounds();
8323
- }
8324
- this.isOverflow !== isOverflow && (this.isOverflow = isOverflow);
8325
- if (!(this.__.__drawAfterFill = this.__.overflow === 'hide') && isOverflow)
8326
- add(renderBounds, childrenRenderBounds);
8348
+ !this.isOverflow !== !isOverflow && (this.isOverflow = isOverflow);
8327
8349
  }
8328
8350
  __updateRectRenderBounds() { }
8329
8351
  __updateRectChange() { }
@@ -8343,20 +8365,9 @@ let Box = class Box extends Group {
8343
8365
  this.__renderGroup(canvas, options);
8344
8366
  }
8345
8367
  }
8346
- __drawAfterFill(canvas, options) {
8347
- const { length } = this.children;
8348
- if (this.isOverflow) {
8349
- canvas.save();
8350
- canvas.clip();
8351
- if (length)
8352
- this.__renderGroup(canvas, options);
8353
- canvas.restore();
8354
- }
8355
- else {
8356
- if (length)
8357
- this.__renderGroup(canvas, options);
8358
- }
8359
- if (this.__.stroke && length) {
8368
+ __drawContent(canvas, options) {
8369
+ this.__renderGroup(canvas, options);
8370
+ if (this.__.__hasStroke) {
8360
8371
  canvas.setWorld(this.__nowWorld);
8361
8372
  this.__drawRenderPath(canvas);
8362
8373
  }
@@ -8520,17 +8531,15 @@ let Line = class Line extends UI {
8520
8531
  if (data.__useArrow)
8521
8532
  PathArrow.addArrows(this, false);
8522
8533
  }
8523
- else {
8534
+ else
8524
8535
  super.__updateRenderPath();
8525
- }
8526
8536
  }
8527
8537
  __updateBoxBounds() {
8528
8538
  if (this.points) {
8529
8539
  toBounds$1(this.__.__pathForRender, this.__layout.boxBounds);
8530
8540
  }
8531
- else {
8541
+ else
8532
8542
  super.__updateBoxBounds();
8533
- }
8534
8543
  }
8535
8544
  };
8536
8545
  __decorate([
@@ -8668,7 +8677,6 @@ let Canvas = class Canvas extends Rect {
8668
8677
  super(data);
8669
8678
  this.canvas = Creator.canvas(this.__);
8670
8679
  this.context = this.canvas.context;
8671
- this.__.__isCanvas = this.__.__drawAfterFill = true;
8672
8680
  if (data && data.url)
8673
8681
  this.drawImage(data.url);
8674
8682
  }
@@ -8681,8 +8689,7 @@ let Canvas = class Canvas extends Rect {
8681
8689
  });
8682
8690
  }
8683
8691
  draw(ui, offset, scale, rotation) {
8684
- ui.__layout.update();
8685
- const matrix = new Matrix(ui.__world).invert();
8692
+ const matrix = new Matrix(ui.worldTransform).invert();
8686
8693
  const m = new Matrix();
8687
8694
  if (offset)
8688
8695
  m.translate(offset.x, offset.y);
@@ -8697,17 +8704,9 @@ let Canvas = class Canvas extends Rect {
8697
8704
  paint() {
8698
8705
  this.forceRender();
8699
8706
  }
8700
- __drawAfterFill(canvas, _options) {
8701
- const { width, height, cornerRadius } = this.__, { view } = this.canvas;
8702
- if (cornerRadius || this.pathInputed) {
8703
- canvas.save();
8704
- canvas.clip();
8705
- canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
8706
- canvas.restore();
8707
- }
8708
- else {
8709
- canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
8710
- }
8707
+ __drawContent(canvas, _options) {
8708
+ const { width, height } = this.__, { view } = this.canvas;
8709
+ canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
8711
8710
  }
8712
8711
  __updateSize() {
8713
8712
  const { canvas } = this;
@@ -8751,7 +8750,6 @@ Canvas = __decorate([
8751
8750
  const { copyAndSpread, includes, isSame: isSame$1, spread, setList } = BoundsHelper;
8752
8751
  let Text = class Text extends UI {
8753
8752
  get __tag() { return 'Text'; }
8754
- get editInner() { return 'TextEditor'; }
8755
8753
  get textDrawData() {
8756
8754
  this.__layout.update();
8757
8755
  return this.__.__textDrawData;
@@ -8917,7 +8915,6 @@ let Path = class Path extends UI {
8917
8915
  get __tag() { return 'Path'; }
8918
8916
  constructor(data) {
8919
8917
  super(data);
8920
- this.__.__pathInputed = 2;
8921
8918
  }
8922
8919
  };
8923
8920
  __decorate([
@@ -9000,21 +8997,17 @@ let App = class App extends Leafer {
9000
8997
  this.tree = this.addLeafer(tree);
9001
8998
  if (sky || editor)
9002
8999
  this.sky = this.addLeafer(sky || { type: 'draw', usePartRender: false });
9003
- if (editor) {
9004
- this.editor = Creator.editor(editor);
9005
- this.sky.add(this.editor);
9006
- }
9000
+ if (editor)
9001
+ this.sky.add(this.editor = Creator.editor(editor));
9007
9002
  }
9008
9003
  }
9009
9004
  __setApp() {
9010
9005
  const { canvas } = this;
9011
9006
  const { realCanvas, view } = this.config;
9012
- if (realCanvas || view === this.canvas.view || !canvas.parentView) {
9007
+ if (realCanvas || view === this.canvas.view || !canvas.parentView)
9013
9008
  this.realCanvas = true;
9014
- }
9015
- else {
9009
+ else
9016
9010
  canvas.unrealCanvas();
9017
- }
9018
9011
  this.leafer = this;
9019
9012
  this.watcher.disable();
9020
9013
  this.layouter.disable();
@@ -9420,10 +9413,7 @@ leafer.initType = function (type) {
9420
9413
  leafer.getValidMove = function (moveX, moveY) {
9421
9414
  const { scroll, disabled } = this.app.config.move;
9422
9415
  if (scroll) {
9423
- if (Math.abs(moveX) > Math.abs(moveY))
9424
- moveY = 0;
9425
- else
9426
- moveX = 0;
9416
+ Math.abs(moveX) > Math.abs(moveY) ? moveY = 0 : moveX = 0;
9427
9417
  if (scroll === 'limit') {
9428
9418
  const { x, y, width, height } = new Bounds(this.__world).addPoint(this.zoomLayer);
9429
9419
  const right = x + width - this.width, bottom = y + height - this.height;
@@ -11507,7 +11497,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
11507
11497
  }
11508
11498
  if (allowPaint) {
11509
11499
  canvas.save();
11510
- canvas.clip();
11500
+ ui.windingRule ? canvas.clip(ui.windingRule) : canvas.clip();
11511
11501
  if (paint.blendMode)
11512
11502
  canvas.blendMode = paint.blendMode;
11513
11503
  if (data.opacity)