leafer-ui 1.0.7 → 1.0.9

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
@@ -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.9";
5963
5966
 
5964
5967
  const debug$7 = Debug.get('LeaferCanvas');
5965
5968
  class LeaferCanvas extends LeaferCanvasBase {
@@ -7133,12 +7136,8 @@ var LeaferUI = (function (exports) {
7133
7136
  };
7134
7137
  const Transition = {
7135
7138
  list: {},
7136
- register(attrName, fn) {
7137
- Transition.list[attrName] = fn;
7138
- },
7139
- get(attrName) {
7140
- return Transition.list[attrName];
7141
- }
7139
+ register(attrName, fn) { Transition.list[attrName] = fn; },
7140
+ get(attrName) { return Transition.list[attrName]; }
7142
7141
  };
7143
7142
 
7144
7143
  const { parse, objectToCanvasData } = PathConvert;
@@ -7584,8 +7583,8 @@ var LeaferUI = (function (exports) {
7584
7583
  pen.set(path = []), this.__drawPathByBox(pen);
7585
7584
  return curve ? PathConvert.toCanvasData(path, true) : path;
7586
7585
  }
7587
- getPathString(curve, pathForRender) {
7588
- return PathConvert.stringify(this.getPath(curve, pathForRender));
7586
+ getPathString(curve, pathForRender, floatLength) {
7587
+ return PathConvert.stringify(this.getPath(curve, pathForRender), floatLength);
7589
7588
  }
7590
7589
  load() {
7591
7590
  this.__.__computePaint();
@@ -7994,11 +7993,11 @@ var LeaferUI = (function (exports) {
7994
7993
  start() {
7995
7994
  clearTimeout(this.__startTimer);
7996
7995
  if (!this.running && this.canvas) {
7996
+ this.running = true;
7997
7997
  this.ready ? this.emitLeafer(LeaferEvent.RESTART) : this.emitLeafer(LeaferEvent.START);
7998
7998
  this.__controllers.forEach(item => item.start());
7999
7999
  if (!this.isApp)
8000
8000
  this.renderer.render();
8001
- this.running = true;
8002
8001
  }
8003
8002
  }
8004
8003
  stop() {
@@ -8104,12 +8103,10 @@ var LeaferUI = (function (exports) {
8104
8103
  }
8105
8104
  __changeFill(newValue) {
8106
8105
  this.config.fill = newValue;
8107
- if (this.canvas.allowBackgroundColor) {
8106
+ if (this.canvas.allowBackgroundColor)
8108
8107
  this.canvas.backgroundColor = newValue;
8109
- }
8110
- else {
8108
+ else
8111
8109
  this.forceRender();
8112
- }
8113
8110
  }
8114
8111
  __onCreated() {
8115
8112
  this.created = true;
@@ -8176,13 +8173,10 @@ var LeaferUI = (function (exports) {
8176
8173
  if (bind)
8177
8174
  item = item.bind(bind);
8178
8175
  this.__viewCompletedWait.push(item);
8179
- if (this.viewCompleted) {
8176
+ if (this.viewCompleted)
8180
8177
  this.__checkViewCompleted(false);
8181
- }
8182
- else {
8183
- if (!this.running)
8184
- this.start();
8185
- }
8178
+ else if (!this.running)
8179
+ this.start();
8186
8180
  }
8187
8181
  nextRender(item, bind, off) {
8188
8182
  if (bind)
@@ -8196,9 +8190,8 @@ var LeaferUI = (function (exports) {
8196
8190
  }
8197
8191
  }
8198
8192
  }
8199
- else {
8193
+ else
8200
8194
  list.push(item);
8201
- }
8202
8195
  }
8203
8196
  zoom(_zoomType, _padding, _fixedScale) {
8204
8197
  return needPlugin('view');
@@ -8242,10 +8235,7 @@ var LeaferUI = (function (exports) {
8242
8235
  this.stop();
8243
8236
  this.emitEvent(new LeaferEvent(LeaferEvent.END, this));
8244
8237
  this.__removeListenEvents();
8245
- this.__controllers.forEach(item => {
8246
- if (!(this.parent && item === this.interaction))
8247
- item.destroy();
8248
- });
8238
+ this.__controllers.forEach(item => !(this.parent && item === this.interaction) && item.destroy());
8249
8239
  this.__controllers.length = 0;
8250
8240
  if (!this.parent) {
8251
8241
  if (this.selector)
@@ -8778,20 +8768,19 @@ var LeaferUI = (function (exports) {
8778
8768
  }
8779
8769
  __updateTextDrawData() {
8780
8770
  const data = this.__;
8781
- data.__textDrawData = TextConvert.getDrawData(data.text, this.__);
8782
- }
8783
- __updateBoxBounds() {
8784
- const data = this.__;
8785
- const layout = this.__layout;
8786
8771
  const { lineHeight, letterSpacing, fontFamily, fontSize, fontWeight, italic, textCase, textOverflow, padding } = data;
8787
- const autoWidth = data.__autoWidth;
8788
- const autoHeight = data.__autoHeight;
8789
8772
  data.__lineHeight = UnitConvert.number(lineHeight, fontSize);
8790
8773
  data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
8791
8774
  data.__padding = padding ? MathHelper.fourNumber(padding) : undefined;
8792
8775
  data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * 0.7) / 2;
8793
8776
  data.__font = `${italic ? 'italic ' : ''}${textCase === 'small-caps' ? 'small-caps ' : ''}${fontWeight !== 'normal' ? fontWeight + ' ' : ''}${fontSize}px ${fontFamily}`;
8794
8777
  data.__clipText = textOverflow !== 'show' && !data.__autoSize;
8778
+ data.__textDrawData = TextConvert.getDrawData(data.text, this.__);
8779
+ }
8780
+ __updateBoxBounds() {
8781
+ const data = this.__;
8782
+ const layout = this.__layout;
8783
+ const { fontSize, italic, padding, __autoWidth: autoWidth, __autoHeight: autoHeight } = data;
8795
8784
  this.__updateTextDrawData();
8796
8785
  const { bounds } = data.__textDrawData;
8797
8786
  const b = layout.boxBounds;
@@ -8804,20 +8793,15 @@ var LeaferUI = (function (exports) {
8804
8793
  b.height = autoHeight ? bounds.height : data.height;
8805
8794
  if (padding) {
8806
8795
  const [top, right, bottom, left] = data.__padding;
8807
- if (autoWidth) {
8808
- b.x -= left;
8809
- b.width += (right + left);
8810
- }
8811
- if (autoHeight) {
8812
- b.y -= top;
8813
- b.height += (bottom + top);
8814
- }
8796
+ if (autoWidth)
8797
+ b.x -= left, b.width += (right + left);
8798
+ if (autoHeight)
8799
+ b.y -= top, b.height += (bottom + top);
8815
8800
  }
8816
8801
  this.__updateNaturalSize();
8817
8802
  }
8818
- else {
8803
+ else
8819
8804
  super.__updateBoxBounds();
8820
- }
8821
8805
  if (italic)
8822
8806
  b.width += fontSize * 0.16;
8823
8807
  const contentBounds = includes(b, bounds) ? b : bounds;
@@ -8940,11 +8924,7 @@ var LeaferUI = (function (exports) {
8940
8924
  this.add(path);
8941
8925
  return this;
8942
8926
  }
8943
- beginPath() {
8944
- this.__path.length = 0;
8945
- this.paint();
8946
- return this;
8947
- }
8927
+ beginPath() { return this; }
8948
8928
  moveTo(_x, _y) { return this; }
8949
8929
  lineTo(_x, _y) { return this; }
8950
8930
  bezierCurveTo(_x1, _y1, _x2, _y2, _x, _y) { return this; }
@@ -8971,7 +8951,7 @@ var LeaferUI = (function (exports) {
8971
8951
  penPathType()
8972
8952
  ], exports.Pen.prototype, "path", void 0);
8973
8953
  exports.Pen = __decorate([
8974
- useModule(PathCreator, ['set', 'beginPath', 'path', 'paint']),
8954
+ useModule(PathCreator, ['set', 'path', 'paint']),
8975
8955
  registerUI()
8976
8956
  ], exports.Pen);
8977
8957
  function penPathType() {
@@ -9073,10 +9053,9 @@ var LeaferUI = (function (exports) {
9073
9053
  }
9074
9054
  __render(canvas, options) {
9075
9055
  if (canvas.context) {
9076
- if (options.matrix) {
9077
- const { a, b, c, d, e, f } = options.matrix;
9078
- canvas.setTransform(a, b, c, d, e, f);
9079
- }
9056
+ const m = options.matrix;
9057
+ if (m)
9058
+ canvas.setTransform(m.a, m.b, m.c, m.d, m.e, m.f);
9080
9059
  this.children.forEach(leafer => canvas.copyWorld(leafer.canvas));
9081
9060
  }
9082
9061
  }
@@ -9146,9 +9125,6 @@ var LeaferUI = (function (exports) {
9146
9125
  constructor(params) {
9147
9126
  super(params.type);
9148
9127
  this.bubbles = true;
9149
- this.getInner = this.getInnerPoint;
9150
- this.getLocal = this.getLocalPoint;
9151
- this.getPage = this.getPagePoint;
9152
9128
  Object.assign(this, params);
9153
9129
  }
9154
9130
  getBoxPoint(relative) {
@@ -9169,6 +9145,9 @@ var LeaferUI = (function (exports) {
9169
9145
  getPagePoint() {
9170
9146
  return this.current.getPagePoint(this);
9171
9147
  }
9148
+ getInner(relative) { return this.getInnerPoint(relative); }
9149
+ getLocal(relative) { return this.getLocalPoint(relative); }
9150
+ getPage() { return this.getPagePoint(); }
9172
9151
  static changeName(oldName, newName) {
9173
9152
  EventCreator.changeName(oldName, newName);
9174
9153
  }
@@ -9200,7 +9179,7 @@ var LeaferUI = (function (exports) {
9200
9179
  ], exports.PointerEvent);
9201
9180
  const MyPointerEvent = exports.PointerEvent;
9202
9181
 
9203
- const move = {};
9182
+ const tempMove = {};
9204
9183
  exports.DragEvent = class DragEvent extends exports.PointerEvent {
9205
9184
  static setList(data) {
9206
9185
  this.list = data instanceof LeafList ? data : new LeafList(data);
@@ -9251,19 +9230,19 @@ var LeaferUI = (function (exports) {
9251
9230
  }
9252
9231
  getPageMove(total) {
9253
9232
  this.assignMove(total);
9254
- return this.current.getPagePoint(move, null, true);
9233
+ return this.current.getPagePoint(tempMove, null, true);
9255
9234
  }
9256
9235
  getInnerMove(relative, total) {
9257
9236
  if (!relative)
9258
9237
  relative = this.current;
9259
9238
  this.assignMove(total);
9260
- return relative.getInnerPoint(move, null, true);
9239
+ return relative.getInnerPoint(tempMove, null, true);
9261
9240
  }
9262
9241
  getLocalMove(relative, total) {
9263
9242
  if (!relative)
9264
9243
  relative = this.current;
9265
9244
  this.assignMove(total);
9266
- return relative.getLocalPoint(move, null, true);
9245
+ return relative.getLocalPoint(tempMove, null, true);
9267
9246
  }
9268
9247
  getPageTotal() {
9269
9248
  return this.getPageMove(true);
@@ -9283,8 +9262,8 @@ var LeaferUI = (function (exports) {
9283
9262
  return bounds;
9284
9263
  }
9285
9264
  assignMove(total) {
9286
- move.x = total ? this.totalX : this.moveX;
9287
- move.y = total ? this.totalY : this.moveY;
9265
+ tempMove.x = total ? this.totalX : this.moveX;
9266
+ tempMove.y = total ? this.totalY : this.moveY;
9288
9267
  }
9289
9268
  };
9290
9269
  exports.DragEvent.BEFORE_DRAG = 'drag.before_drag';
@@ -9698,9 +9677,8 @@ var LeaferUI = (function (exports) {
9698
9677
  interaction.emit(exports.DragEvent.OVER, data, path);
9699
9678
  }
9700
9679
  }
9701
- else {
9680
+ else
9702
9681
  interaction.emit(exports.DragEvent.OVER, data, path);
9703
- }
9704
9682
  }
9705
9683
  dragEnterOrLeave(data) {
9706
9684
  const { interaction } = this;
@@ -9721,9 +9699,8 @@ var LeaferUI = (function (exports) {
9721
9699
  this.drag(data);
9722
9700
  this.animate(() => { this.dragEnd(data, 1); });
9723
9701
  }
9724
- else {
9702
+ else
9725
9703
  this.dragEndReal(data);
9726
- }
9727
9704
  }
9728
9705
  dragEndReal(data) {
9729
9706
  const { interaction, downData, dragData } = this;
@@ -9920,14 +9897,16 @@ var LeaferUI = (function (exports) {
9920
9897
  class InteractionBase {
9921
9898
  get dragging() { return this.dragger.dragging; }
9922
9899
  get transforming() { return this.transformer.transforming; }
9923
- get moveMode() { return this.config.move.drag === true || this.isHoldSpaceKey || this.isHoldMiddleKey || (this.isHoldRightKey && this.dragger.moving) || this.isDragEmpty; }
9924
- get canHover() { return this.config.pointer.hover && !this.config.mobile; }
9925
- get isDragEmpty() { return this.config.move.dragEmpty && this.isRootPath(this.hoverData) && (!this.downData || this.isRootPath(this.downData)); }
9926
- get isMobileDragEmpty() { return this.config.move.dragEmpty && !this.canHover && this.downData && this.isTreePath(this.downData); }
9927
- get isHoldMiddleKey() { return this.config.move.holdMiddleKey && this.downData && PointerButton.middle(this.downData); }
9928
- get isHoldRightKey() { return this.config.move.holdRightKey && this.downData && PointerButton.right(this.downData); }
9929
- get isHoldSpaceKey() { return this.config.move.holdSpaceKey && Keyboard.isHoldSpaceKey(); }
9930
- get hitRadius() { return this.config.pointer.hitRadius; }
9900
+ get moveMode() { return this.m.drag === true || this.isHoldSpaceKey || this.isHoldMiddleKey || (this.isHoldRightKey && this.dragger.moving) || this.isDragEmpty; }
9901
+ get canHover() { return this.p.hover && !this.config.mobile; }
9902
+ get isDragEmpty() { return this.m.dragEmpty && this.isRootPath(this.hoverData) && (!this.downData || this.isRootPath(this.downData)); }
9903
+ get isMobileDragEmpty() { return this.m.dragEmpty && !this.canHover && this.downData && this.isTreePath(this.downData); }
9904
+ get isHoldMiddleKey() { return this.m.holdMiddleKey && this.downData && PointerButton.middle(this.downData); }
9905
+ get isHoldRightKey() { return this.m.holdRightKey && this.downData && PointerButton.right(this.downData); }
9906
+ get isHoldSpaceKey() { return this.m.holdSpaceKey && Keyboard.isHoldSpaceKey(); }
9907
+ get m() { return this.config.move; }
9908
+ get p() { return this.config.pointer; }
9909
+ get hitRadius() { return this.p.hitRadius; }
9931
9910
  constructor(target, canvas, selector, userConfig) {
9932
9911
  this.config = DataHelper.clone(config);
9933
9912
  this.tapCount = 0;
@@ -9985,7 +9964,7 @@ var LeaferUI = (function (exports) {
9985
9964
  }
9986
9965
  }
9987
9966
  pointerMoveReal(data) {
9988
- const { dragHover, dragDistance } = this.config.pointer;
9967
+ const { dragHover, dragDistance } = this.p;
9989
9968
  this.emit(exports.PointerEvent.BEFORE_MOVE, data, this.defaultPath);
9990
9969
  if (this.downData) {
9991
9970
  const canDrag = PointHelper.getDistance(this.downData, data) > dragDistance;
@@ -10170,7 +10149,7 @@ var LeaferUI = (function (exports) {
10170
10149
  }
10171
10150
  }
10172
10151
  findPath(data, options) {
10173
- const { hitRadius, through } = this.config.pointer;
10152
+ const { hitRadius, through } = this.p;
10174
10153
  const { bottomList } = this;
10175
10154
  const find = this.selector.getByPoint(data, hitRadius, Object.assign({ bottomList, name: data.type }, (options || { through })));
10176
10155
  if (find.throughPath)
@@ -10192,7 +10171,7 @@ var LeaferUI = (function (exports) {
10192
10171
  data.path = this.defaultPath;
10193
10172
  }
10194
10173
  canMove(data) {
10195
- return data && (this.moveMode || (this.config.move.drag === 'auto' && !pathCanDrag$1(data.path))) && !pathHasOutside(data.path);
10174
+ return data && (this.moveMode || (this.m.drag === 'auto' && !pathCanDrag$1(data.path))) && !pathHasOutside(data.path);
10196
10175
  }
10197
10176
  isDrag(leaf) {
10198
10177
  return this.dragger.getList().has(leaf);
@@ -10290,7 +10269,7 @@ var LeaferUI = (function (exports) {
10290
10269
  this.longPressTimer = setTimeout(() => {
10291
10270
  this.longPressed = true;
10292
10271
  this.emit(exports.PointerEvent.LONG_PRESS, data);
10293
- }, this.config.pointer.longPressTime);
10272
+ }, this.p.longPressTime);
10294
10273
  }
10295
10274
  longTap(data) {
10296
10275
  let hasLong;
@@ -10895,14 +10874,10 @@ var LeaferUI = (function (exports) {
10895
10874
  const { rows, decorationY, decorationHeight } = ui.__.__textDrawData;
10896
10875
  for (let i = 0, len = rows.length; i < len; i++) {
10897
10876
  row = rows[i];
10898
- if (row.text) {
10877
+ if (row.text)
10899
10878
  canvas.fillText(row.text, row.x, row.y);
10900
- }
10901
- else if (row.data) {
10902
- row.data.forEach(charData => {
10903
- canvas.fillText(charData.char, charData.x, row.y);
10904
- });
10905
- }
10879
+ else if (row.data)
10880
+ row.data.forEach(charData => { canvas.fillText(charData.char, charData.x, row.y); });
10906
10881
  if (decorationY)
10907
10882
  canvas.fillRect(row.x, row.y + decorationY, row.width, decorationHeight);
10908
10883
  }
@@ -10968,12 +10943,10 @@ var LeaferUI = (function (exports) {
10968
10943
  out.blendMode = align === 'outside' ? 'destination-out' : 'destination-in';
10969
10944
  fillText(ui, out);
10970
10945
  out.blendMode = 'normal';
10971
- if (ui.__worldFlipped) {
10946
+ if (ui.__worldFlipped)
10972
10947
  canvas.copyWorldByReset(out, ui.__nowWorld);
10973
- }
10974
- else {
10948
+ else
10975
10949
  canvas.copyWorldToInner(out, ui.__nowWorld, ui.__layout.renderBounds);
10976
- }
10977
10950
  out.recycle(ui.__nowWorld);
10978
10951
  }
10979
10952
  function drawTextStroke(ui, canvas) {
@@ -10981,14 +10954,10 @@ var LeaferUI = (function (exports) {
10981
10954
  const { rows, decorationY, decorationHeight } = ui.__.__textDrawData;
10982
10955
  for (let i = 0, len = rows.length; i < len; i++) {
10983
10956
  row = rows[i];
10984
- if (row.text) {
10957
+ if (row.text)
10985
10958
  canvas.strokeText(row.text, row.x, row.y);
10986
- }
10987
- else if (row.data) {
10988
- row.data.forEach(charData => {
10989
- canvas.strokeText(charData.char, charData.x, row.y);
10990
- });
10991
- }
10959
+ else if (row.data)
10960
+ row.data.forEach(charData => { canvas.strokeText(charData.char, charData.x, row.y); });
10992
10961
  if (decorationY)
10993
10962
  canvas.strokeRect(row.x, row.y + decorationY, row.width, decorationHeight);
10994
10963
  }
@@ -11041,12 +11010,10 @@ var LeaferUI = (function (exports) {
11041
11010
  out.stroke();
11042
11011
  options.windingRule ? out.clip(options.windingRule) : out.clip();
11043
11012
  out.clearWorld(ui.__layout.renderBounds);
11044
- if (ui.__worldFlipped) {
11013
+ if (ui.__worldFlipped)
11045
11014
  canvas.copyWorldByReset(out, ui.__nowWorld);
11046
- }
11047
- else {
11015
+ else
11048
11016
  canvas.copyWorldToInner(out, ui.__nowWorld, ui.__layout.renderBounds);
11049
- }
11050
11017
  out.recycle(ui.__nowWorld);
11051
11018
  break;
11052
11019
  }
@@ -11081,12 +11048,10 @@ var LeaferUI = (function (exports) {
11081
11048
  drawStrokesStyle(strokes, false, ui, out);
11082
11049
  options.windingRule ? out.clip(options.windingRule) : out.clip();
11083
11050
  out.clearWorld(renderBounds);
11084
- if (ui.__worldFlipped) {
11051
+ if (ui.__worldFlipped)
11085
11052
  canvas.copyWorldByReset(out, ui.__nowWorld);
11086
- }
11087
- else {
11053
+ else
11088
11054
  canvas.copyWorldToInner(out, ui.__nowWorld, renderBounds);
11089
- }
11090
11055
  out.recycle(ui.__nowWorld);
11091
11056
  break;
11092
11057
  }
@@ -11150,12 +11115,7 @@ var LeaferUI = (function (exports) {
11150
11115
  data['_' + attrName] = leafPaints.length ? leafPaints : undefined;
11151
11116
  if (leafPaints.length && leafPaints[0].image)
11152
11117
  hasOpacityPixel = leafPaints[0].image.hasOpacityPixel;
11153
- if (attrName === 'fill') {
11154
- data.__pixelFill = hasOpacityPixel;
11155
- }
11156
- else {
11157
- data.__pixelStroke = hasOpacityPixel;
11158
- }
11118
+ attrName === 'fill' ? data.__pixelFill = hasOpacityPixel : data.__pixelStroke = hasOpacityPixel;
11159
11119
  }
11160
11120
  function getLeafPaint(attrName, paint, ui) {
11161
11121
  if (typeof paint !== 'object' || paint.visible === false || paint.opacity === 0)