@leafer-ui/worker 1.0.7 → 1.0.8

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/worker.js CHANGED
@@ -2961,7 +2961,6 @@ var LeaferUI = (function (exports) {
2961
2961
  set path(value) { this.__path = value; }
2962
2962
  get path() { return this.__path; }
2963
2963
  constructor(path) {
2964
- this.clearPath = this.beginPath;
2965
2964
  this.set(path);
2966
2965
  }
2967
2966
  set(path) {
@@ -3043,6 +3042,9 @@ var LeaferUI = (function (exports) {
3043
3042
  this.paint();
3044
3043
  return this;
3045
3044
  }
3045
+ clearPath() {
3046
+ return this.beginPath();
3047
+ }
3046
3048
  paint() { }
3047
3049
  }
3048
3050
 
@@ -3638,6 +3640,8 @@ var LeaferUI = (function (exports) {
3638
3640
  else {
3639
3641
  if (url.includes('.' + format) || url.includes('.' + FileHelper.upperCaseTypeMap[format]))
3640
3642
  return true;
3643
+ else if (format === 'png' && !url.includes('.'))
3644
+ return true;
3641
3645
  }
3642
3646
  return false;
3643
3647
  },
@@ -5255,7 +5259,7 @@ var LeaferUI = (function (exports) {
5255
5259
  const { LEAF, create } = IncrementId;
5256
5260
  const { toInnerPoint, toOuterPoint, multiplyParent } = MatrixHelper;
5257
5261
  const { toOuterOf } = BoundsHelper;
5258
- const { copy: copy$4, move: move$1 } = PointHelper;
5262
+ const { copy: copy$4, move } = PointHelper;
5259
5263
  const { moveLocal, zoomOfLocal, rotateOfLocal, skewOfLocal, moveWorld, zoomOfWorld, rotateOfWorld, skewOfWorld, transform, transformWorld, setTransform, getFlipTransform, getLocalOrigin, getRelativeWorld, drop } = LeafHelper;
5260
5264
  exports.Leaf = class Leaf {
5261
5265
  get tag() { return this.__tag; }
@@ -5490,7 +5494,7 @@ var LeaferUI = (function (exports) {
5490
5494
  }
5491
5495
  getBoxPointByInner(inner, _relative, _distance, change) {
5492
5496
  const point = change ? inner : Object.assign({}, inner), { x, y } = this.boxBounds;
5493
- move$1(point, -x, -y);
5497
+ move(point, -x, -y);
5494
5498
  return point;
5495
5499
  }
5496
5500
  getInnerPoint(world, relative, distance, change) {
@@ -5500,7 +5504,7 @@ var LeaferUI = (function (exports) {
5500
5504
  }
5501
5505
  getInnerPointByBox(box, _relative, _distance, change) {
5502
5506
  const point = change ? box : Object.assign({}, box), { x, y } = this.boxBounds;
5503
- move$1(point, x, y);
5507
+ move(point, x, y);
5504
5508
  return point;
5505
5509
  }
5506
5510
  getInnerPointByLocal(local, _relative, distance, change) {
@@ -5641,11 +5645,10 @@ var LeaferUI = (function (exports) {
5641
5645
  }
5642
5646
  destroy() {
5643
5647
  if (!this.destroyed) {
5644
- const { parent } = this;
5645
- if (parent)
5648
+ if (this.parent)
5646
5649
  this.remove();
5647
5650
  if (this.children)
5648
- this.removeAll(true);
5651
+ this.clear();
5649
5652
  this.__emitLifeEvent(ChildEvent.DESTROY);
5650
5653
  this.__.destroy();
5651
5654
  this.__layout.destroy();
@@ -5959,7 +5962,7 @@ var LeaferUI = (function (exports) {
5959
5962
  }
5960
5963
  }
5961
5964
 
5962
- const version = "1.0.7";
5965
+ const version = "1.0.8";
5963
5966
 
5964
5967
  class LeaferCanvas extends LeaferCanvasBase {
5965
5968
  get allowBackgroundColor() { return true; }
@@ -6960,12 +6963,8 @@ var LeaferUI = (function (exports) {
6960
6963
  };
6961
6964
  const Transition = {
6962
6965
  list: {},
6963
- register(attrName, fn) {
6964
- Transition.list[attrName] = fn;
6965
- },
6966
- get(attrName) {
6967
- return Transition.list[attrName];
6968
- }
6966
+ register(attrName, fn) { Transition.list[attrName] = fn; },
6967
+ get(attrName) { return Transition.list[attrName]; }
6969
6968
  };
6970
6969
 
6971
6970
  const { parse, objectToCanvasData } = PathConvert;
@@ -7411,8 +7410,8 @@ var LeaferUI = (function (exports) {
7411
7410
  pen.set(path = []), this.__drawPathByBox(pen);
7412
7411
  return curve ? PathConvert.toCanvasData(path, true) : path;
7413
7412
  }
7414
- getPathString(curve, pathForRender) {
7415
- return PathConvert.stringify(this.getPath(curve, pathForRender));
7413
+ getPathString(curve, pathForRender, floatLength) {
7414
+ return PathConvert.stringify(this.getPath(curve, pathForRender), floatLength);
7416
7415
  }
7417
7416
  load() {
7418
7417
  this.__.__computePaint();
@@ -7821,11 +7820,11 @@ var LeaferUI = (function (exports) {
7821
7820
  start() {
7822
7821
  clearTimeout(this.__startTimer);
7823
7822
  if (!this.running && this.canvas) {
7823
+ this.running = true;
7824
7824
  this.ready ? this.emitLeafer(LeaferEvent.RESTART) : this.emitLeafer(LeaferEvent.START);
7825
7825
  this.__controllers.forEach(item => item.start());
7826
7826
  if (!this.isApp)
7827
7827
  this.renderer.render();
7828
- this.running = true;
7829
7828
  }
7830
7829
  }
7831
7830
  stop() {
@@ -7931,12 +7930,10 @@ var LeaferUI = (function (exports) {
7931
7930
  }
7932
7931
  __changeFill(newValue) {
7933
7932
  this.config.fill = newValue;
7934
- if (this.canvas.allowBackgroundColor) {
7933
+ if (this.canvas.allowBackgroundColor)
7935
7934
  this.canvas.backgroundColor = newValue;
7936
- }
7937
- else {
7935
+ else
7938
7936
  this.forceRender();
7939
- }
7940
7937
  }
7941
7938
  __onCreated() {
7942
7939
  this.created = true;
@@ -8003,13 +8000,10 @@ var LeaferUI = (function (exports) {
8003
8000
  if (bind)
8004
8001
  item = item.bind(bind);
8005
8002
  this.__viewCompletedWait.push(item);
8006
- if (this.viewCompleted) {
8003
+ if (this.viewCompleted)
8007
8004
  this.__checkViewCompleted(false);
8008
- }
8009
- else {
8010
- if (!this.running)
8011
- this.start();
8012
- }
8005
+ else if (!this.running)
8006
+ this.start();
8013
8007
  }
8014
8008
  nextRender(item, bind, off) {
8015
8009
  if (bind)
@@ -8023,9 +8017,8 @@ var LeaferUI = (function (exports) {
8023
8017
  }
8024
8018
  }
8025
8019
  }
8026
- else {
8020
+ else
8027
8021
  list.push(item);
8028
- }
8029
8022
  }
8030
8023
  zoom(_zoomType, _padding, _fixedScale) {
8031
8024
  return needPlugin('view');
@@ -8069,10 +8062,7 @@ var LeaferUI = (function (exports) {
8069
8062
  this.stop();
8070
8063
  this.emitEvent(new LeaferEvent(LeaferEvent.END, this));
8071
8064
  this.__removeListenEvents();
8072
- this.__controllers.forEach(item => {
8073
- if (!(this.parent && item === this.interaction))
8074
- item.destroy();
8075
- });
8065
+ this.__controllers.forEach(item => !(this.parent && item === this.interaction) && item.destroy());
8076
8066
  this.__controllers.length = 0;
8077
8067
  if (!this.parent) {
8078
8068
  if (this.selector)
@@ -8605,23 +8595,23 @@ var LeaferUI = (function (exports) {
8605
8595
  }
8606
8596
  __updateTextDrawData() {
8607
8597
  const data = this.__;
8608
- data.__textDrawData = TextConvert.getDrawData(data.text, this.__);
8609
- }
8610
- __updateBoxBounds() {
8611
- const data = this.__;
8612
- const layout = this.__layout;
8613
8598
  const { lineHeight, letterSpacing, fontFamily, fontSize, fontWeight, italic, textCase, textOverflow, padding } = data;
8614
- const autoWidth = data.__autoWidth;
8615
- const autoHeight = data.__autoHeight;
8616
8599
  data.__lineHeight = UnitConvert.number(lineHeight, fontSize);
8617
8600
  data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
8618
8601
  data.__padding = padding ? MathHelper.fourNumber(padding) : undefined;
8619
8602
  data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * 0.7) / 2;
8620
8603
  data.__font = `${italic ? 'italic ' : ''}${textCase === 'small-caps' ? 'small-caps ' : ''}${fontWeight !== 'normal' ? fontWeight + ' ' : ''}${fontSize}px ${fontFamily}`;
8621
8604
  data.__clipText = textOverflow !== 'show' && !data.__autoSize;
8605
+ data.__textDrawData = TextConvert.getDrawData(data.text, this.__);
8606
+ }
8607
+ __updateBoxBounds() {
8608
+ const data = this.__;
8609
+ const layout = this.__layout;
8610
+ const { fontSize, italic, padding, __autoWidth: autoWidth, __autoHeight: autoHeight } = data;
8622
8611
  this.__updateTextDrawData();
8623
8612
  const { bounds } = data.__textDrawData;
8624
8613
  const b = layout.boxBounds;
8614
+ console.log(bounds, autoWidth, autoHeight);
8625
8615
  if (data.__lineHeight < fontSize)
8626
8616
  spread(bounds, fontSize / 2);
8627
8617
  if (autoWidth || autoHeight) {
@@ -8631,20 +8621,15 @@ var LeaferUI = (function (exports) {
8631
8621
  b.height = autoHeight ? bounds.height : data.height;
8632
8622
  if (padding) {
8633
8623
  const [top, right, bottom, left] = data.__padding;
8634
- if (autoWidth) {
8635
- b.x -= left;
8636
- b.width += (right + left);
8637
- }
8638
- if (autoHeight) {
8639
- b.y -= top;
8640
- b.height += (bottom + top);
8641
- }
8624
+ if (autoWidth)
8625
+ b.x -= left, b.width += (right + left);
8626
+ if (autoHeight)
8627
+ b.y -= top, b.height += (bottom + top);
8642
8628
  }
8643
8629
  this.__updateNaturalSize();
8644
8630
  }
8645
- else {
8631
+ else
8646
8632
  super.__updateBoxBounds();
8647
- }
8648
8633
  if (italic)
8649
8634
  b.width += fontSize * 0.16;
8650
8635
  const contentBounds = includes(b, bounds) ? b : bounds;
@@ -8767,11 +8752,7 @@ var LeaferUI = (function (exports) {
8767
8752
  this.add(path);
8768
8753
  return this;
8769
8754
  }
8770
- beginPath() {
8771
- this.__path.length = 0;
8772
- this.paint();
8773
- return this;
8774
- }
8755
+ beginPath() { return this; }
8775
8756
  moveTo(_x, _y) { return this; }
8776
8757
  lineTo(_x, _y) { return this; }
8777
8758
  bezierCurveTo(_x1, _y1, _x2, _y2, _x, _y) { return this; }
@@ -8798,7 +8779,7 @@ var LeaferUI = (function (exports) {
8798
8779
  penPathType()
8799
8780
  ], exports.Pen.prototype, "path", void 0);
8800
8781
  exports.Pen = __decorate([
8801
- useModule(PathCreator, ['set', 'beginPath', 'path', 'paint']),
8782
+ useModule(PathCreator, ['set', 'path', 'paint']),
8802
8783
  registerUI()
8803
8784
  ], exports.Pen);
8804
8785
  function penPathType() {
@@ -8900,10 +8881,9 @@ var LeaferUI = (function (exports) {
8900
8881
  }
8901
8882
  __render(canvas, options) {
8902
8883
  if (canvas.context) {
8903
- if (options.matrix) {
8904
- const { a, b, c, d, e, f } = options.matrix;
8905
- canvas.setTransform(a, b, c, d, e, f);
8906
- }
8884
+ const m = options.matrix;
8885
+ if (m)
8886
+ canvas.setTransform(m.a, m.b, m.c, m.d, m.e, m.f);
8907
8887
  this.children.forEach(leafer => canvas.copyWorld(leafer.canvas));
8908
8888
  }
8909
8889
  }
@@ -8973,9 +8953,6 @@ var LeaferUI = (function (exports) {
8973
8953
  constructor(params) {
8974
8954
  super(params.type);
8975
8955
  this.bubbles = true;
8976
- this.getInner = this.getInnerPoint;
8977
- this.getLocal = this.getLocalPoint;
8978
- this.getPage = this.getPagePoint;
8979
8956
  Object.assign(this, params);
8980
8957
  }
8981
8958
  getBoxPoint(relative) {
@@ -8996,6 +8973,9 @@ var LeaferUI = (function (exports) {
8996
8973
  getPagePoint() {
8997
8974
  return this.current.getPagePoint(this);
8998
8975
  }
8976
+ getInner(relative) { return this.getInnerPoint(relative); }
8977
+ getLocal(relative) { return this.getLocalPoint(relative); }
8978
+ getPage() { return this.getPagePoint(); }
8999
8979
  static changeName(oldName, newName) {
9000
8980
  EventCreator.changeName(oldName, newName);
9001
8981
  }
@@ -9027,7 +9007,7 @@ var LeaferUI = (function (exports) {
9027
9007
  ], exports.PointerEvent);
9028
9008
  const MyPointerEvent = exports.PointerEvent;
9029
9009
 
9030
- const move = {};
9010
+ const tempMove = {};
9031
9011
  exports.DragEvent = class DragEvent extends exports.PointerEvent {
9032
9012
  static setList(data) {
9033
9013
  this.list = data instanceof LeafList ? data : new LeafList(data);
@@ -9078,19 +9058,19 @@ var LeaferUI = (function (exports) {
9078
9058
  }
9079
9059
  getPageMove(total) {
9080
9060
  this.assignMove(total);
9081
- return this.current.getPagePoint(move, null, true);
9061
+ return this.current.getPagePoint(tempMove, null, true);
9082
9062
  }
9083
9063
  getInnerMove(relative, total) {
9084
9064
  if (!relative)
9085
9065
  relative = this.current;
9086
9066
  this.assignMove(total);
9087
- return relative.getInnerPoint(move, null, true);
9067
+ return relative.getInnerPoint(tempMove, null, true);
9088
9068
  }
9089
9069
  getLocalMove(relative, total) {
9090
9070
  if (!relative)
9091
9071
  relative = this.current;
9092
9072
  this.assignMove(total);
9093
- return relative.getLocalPoint(move, null, true);
9073
+ return relative.getLocalPoint(tempMove, null, true);
9094
9074
  }
9095
9075
  getPageTotal() {
9096
9076
  return this.getPageMove(true);
@@ -9110,8 +9090,8 @@ var LeaferUI = (function (exports) {
9110
9090
  return bounds;
9111
9091
  }
9112
9092
  assignMove(total) {
9113
- move.x = total ? this.totalX : this.moveX;
9114
- move.y = total ? this.totalY : this.moveY;
9093
+ tempMove.x = total ? this.totalX : this.moveX;
9094
+ tempMove.y = total ? this.totalY : this.moveY;
9115
9095
  }
9116
9096
  };
9117
9097
  exports.DragEvent.BEFORE_DRAG = 'drag.before_drag';
@@ -9525,9 +9505,8 @@ var LeaferUI = (function (exports) {
9525
9505
  interaction.emit(exports.DragEvent.OVER, data, path);
9526
9506
  }
9527
9507
  }
9528
- else {
9508
+ else
9529
9509
  interaction.emit(exports.DragEvent.OVER, data, path);
9530
- }
9531
9510
  }
9532
9511
  dragEnterOrLeave(data) {
9533
9512
  const { interaction } = this;
@@ -9548,9 +9527,8 @@ var LeaferUI = (function (exports) {
9548
9527
  this.drag(data);
9549
9528
  this.animate(() => { this.dragEnd(data, 1); });
9550
9529
  }
9551
- else {
9530
+ else
9552
9531
  this.dragEndReal(data);
9553
- }
9554
9532
  }
9555
9533
  dragEndReal(data) {
9556
9534
  const { interaction, downData, dragData } = this;
@@ -9747,14 +9725,16 @@ var LeaferUI = (function (exports) {
9747
9725
  class InteractionBase {
9748
9726
  get dragging() { return this.dragger.dragging; }
9749
9727
  get transforming() { return this.transformer.transforming; }
9750
- get moveMode() { return this.config.move.drag === true || this.isHoldSpaceKey || this.isHoldMiddleKey || (this.isHoldRightKey && this.dragger.moving) || this.isDragEmpty; }
9751
- get canHover() { return this.config.pointer.hover && !this.config.mobile; }
9752
- get isDragEmpty() { return this.config.move.dragEmpty && this.isRootPath(this.hoverData) && (!this.downData || this.isRootPath(this.downData)); }
9753
- get isMobileDragEmpty() { return this.config.move.dragEmpty && !this.canHover && this.downData && this.isTreePath(this.downData); }
9754
- get isHoldMiddleKey() { return this.config.move.holdMiddleKey && this.downData && PointerButton.middle(this.downData); }
9755
- get isHoldRightKey() { return this.config.move.holdRightKey && this.downData && PointerButton.right(this.downData); }
9756
- get isHoldSpaceKey() { return this.config.move.holdSpaceKey && Keyboard.isHoldSpaceKey(); }
9757
- get hitRadius() { return this.config.pointer.hitRadius; }
9728
+ get moveMode() { return this.m.drag === true || this.isHoldSpaceKey || this.isHoldMiddleKey || (this.isHoldRightKey && this.dragger.moving) || this.isDragEmpty; }
9729
+ get canHover() { return this.p.hover && !this.config.mobile; }
9730
+ get isDragEmpty() { return this.m.dragEmpty && this.isRootPath(this.hoverData) && (!this.downData || this.isRootPath(this.downData)); }
9731
+ get isMobileDragEmpty() { return this.m.dragEmpty && !this.canHover && this.downData && this.isTreePath(this.downData); }
9732
+ get isHoldMiddleKey() { return this.m.holdMiddleKey && this.downData && PointerButton.middle(this.downData); }
9733
+ get isHoldRightKey() { return this.m.holdRightKey && this.downData && PointerButton.right(this.downData); }
9734
+ get isHoldSpaceKey() { return this.m.holdSpaceKey && Keyboard.isHoldSpaceKey(); }
9735
+ get m() { return this.config.move; }
9736
+ get p() { return this.config.pointer; }
9737
+ get hitRadius() { return this.p.hitRadius; }
9758
9738
  constructor(target, canvas, selector, userConfig) {
9759
9739
  this.config = DataHelper.clone(config);
9760
9740
  this.tapCount = 0;
@@ -9812,7 +9792,7 @@ var LeaferUI = (function (exports) {
9812
9792
  }
9813
9793
  }
9814
9794
  pointerMoveReal(data) {
9815
- const { dragHover, dragDistance } = this.config.pointer;
9795
+ const { dragHover, dragDistance } = this.p;
9816
9796
  this.emit(exports.PointerEvent.BEFORE_MOVE, data, this.defaultPath);
9817
9797
  if (this.downData) {
9818
9798
  const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance;
@@ -9997,7 +9977,7 @@ var LeaferUI = (function (exports) {
9997
9977
  }
9998
9978
  }
9999
9979
  findPath(data, options) {
10000
- const { hitRadius, through } = this.config.pointer;
9980
+ const { hitRadius, through } = this.p;
10001
9981
  const { bottomList } = this;
10002
9982
  const find = this.selector.getByPoint(data, hitRadius, Object.assign({ bottomList, name: data.type }, (options || { through })));
10003
9983
  if (find.throughPath)
@@ -10019,7 +9999,7 @@ var LeaferUI = (function (exports) {
10019
9999
  data.path = this.defaultPath;
10020
10000
  }
10021
10001
  canMove(data) {
10022
- return data && (this.moveMode || (this.config.move.drag === 'auto' && !pathCanDrag(data.path))) && !pathHasOutside(data.path);
10002
+ return data && (this.moveMode || (this.m.drag === 'auto' && !pathCanDrag(data.path))) && !pathHasOutside(data.path);
10023
10003
  }
10024
10004
  isDrag(leaf) {
10025
10005
  return this.dragger.getList().has(leaf);
@@ -10117,7 +10097,7 @@ var LeaferUI = (function (exports) {
10117
10097
  this.longPressTimer = setTimeout(() => {
10118
10098
  this.longPressed = true;
10119
10099
  this.emit(exports.PointerEvent.LONG_PRESS, data);
10120
- }, this.config.pointer.longPressTime);
10100
+ }, this.p.longPressTime);
10121
10101
  }
10122
10102
  longTap(data) {
10123
10103
  let hasLong;
@@ -10370,14 +10350,10 @@ var LeaferUI = (function (exports) {
10370
10350
  const { rows, decorationY, decorationHeight } = ui.__.__textDrawData;
10371
10351
  for (let i = 0, len = rows.length; i < len; i++) {
10372
10352
  row = rows[i];
10373
- if (row.text) {
10353
+ if (row.text)
10374
10354
  canvas.fillText(row.text, row.x, row.y);
10375
- }
10376
- else if (row.data) {
10377
- row.data.forEach(charData => {
10378
- canvas.fillText(charData.char, charData.x, row.y);
10379
- });
10380
- }
10355
+ else if (row.data)
10356
+ row.data.forEach(charData => { canvas.fillText(charData.char, charData.x, row.y); });
10381
10357
  if (decorationY)
10382
10358
  canvas.fillRect(row.x, row.y + decorationY, row.width, decorationHeight);
10383
10359
  }
@@ -10443,12 +10419,10 @@ var LeaferUI = (function (exports) {
10443
10419
  out.blendMode = align === 'outside' ? 'destination-out' : 'destination-in';
10444
10420
  fillText(ui, out);
10445
10421
  out.blendMode = 'normal';
10446
- if (ui.__worldFlipped) {
10422
+ if (ui.__worldFlipped)
10447
10423
  canvas.copyWorldByReset(out, ui.__nowWorld);
10448
- }
10449
- else {
10424
+ else
10450
10425
  canvas.copyWorldToInner(out, ui.__nowWorld, ui.__layout.renderBounds);
10451
- }
10452
10426
  out.recycle(ui.__nowWorld);
10453
10427
  }
10454
10428
  function drawTextStroke(ui, canvas) {
@@ -10456,14 +10430,10 @@ var LeaferUI = (function (exports) {
10456
10430
  const { rows, decorationY, decorationHeight } = ui.__.__textDrawData;
10457
10431
  for (let i = 0, len = rows.length; i < len; i++) {
10458
10432
  row = rows[i];
10459
- if (row.text) {
10433
+ if (row.text)
10460
10434
  canvas.strokeText(row.text, row.x, row.y);
10461
- }
10462
- else if (row.data) {
10463
- row.data.forEach(charData => {
10464
- canvas.strokeText(charData.char, charData.x, row.y);
10465
- });
10466
- }
10435
+ else if (row.data)
10436
+ row.data.forEach(charData => { canvas.strokeText(charData.char, charData.x, row.y); });
10467
10437
  if (decorationY)
10468
10438
  canvas.strokeRect(row.x, row.y + decorationY, row.width, decorationHeight);
10469
10439
  }
@@ -10516,12 +10486,10 @@ var LeaferUI = (function (exports) {
10516
10486
  out.stroke();
10517
10487
  options.windingRule ? out.clip(options.windingRule) : out.clip();
10518
10488
  out.clearWorld(ui.__layout.renderBounds);
10519
- if (ui.__worldFlipped) {
10489
+ if (ui.__worldFlipped)
10520
10490
  canvas.copyWorldByReset(out, ui.__nowWorld);
10521
- }
10522
- else {
10491
+ else
10523
10492
  canvas.copyWorldToInner(out, ui.__nowWorld, ui.__layout.renderBounds);
10524
- }
10525
10493
  out.recycle(ui.__nowWorld);
10526
10494
  break;
10527
10495
  }
@@ -10556,12 +10524,10 @@ var LeaferUI = (function (exports) {
10556
10524
  drawStrokesStyle(strokes, false, ui, out);
10557
10525
  options.windingRule ? out.clip(options.windingRule) : out.clip();
10558
10526
  out.clearWorld(renderBounds);
10559
- if (ui.__worldFlipped) {
10527
+ if (ui.__worldFlipped)
10560
10528
  canvas.copyWorldByReset(out, ui.__nowWorld);
10561
- }
10562
- else {
10529
+ else
10563
10530
  canvas.copyWorldToInner(out, ui.__nowWorld, renderBounds);
10564
- }
10565
10531
  out.recycle(ui.__nowWorld);
10566
10532
  break;
10567
10533
  }
@@ -10625,12 +10591,7 @@ var LeaferUI = (function (exports) {
10625
10591
  data['_' + attrName] = leafPaints.length ? leafPaints : undefined;
10626
10592
  if (leafPaints.length && leafPaints[0].image)
10627
10593
  hasOpacityPixel = leafPaints[0].image.hasOpacityPixel;
10628
- if (attrName === 'fill') {
10629
- data.__pixelFill = hasOpacityPixel;
10630
- }
10631
- else {
10632
- data.__pixelStroke = hasOpacityPixel;
10633
- }
10594
+ attrName === 'fill' ? data.__pixelFill = hasOpacityPixel : data.__pixelStroke = hasOpacityPixel;
10634
10595
  }
10635
10596
  function getLeafPaint(attrName, paint, ui) {
10636
10597
  if (typeof paint !== 'object' || paint.visible === false || paint.opacity === 0)