@leafer-ui/worker 1.0.3 → 1.0.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.
package/dist/worker.js CHANGED
@@ -4486,15 +4486,16 @@ var LeaferUI = (function (exports) {
4486
4486
  }
4487
4487
  getLayoutBounds(type, relative = 'world', unscale) {
4488
4488
  const { leaf } = this;
4489
- let point, matrix, bounds = this.getInnerBounds(type);
4489
+ let point, matrix, layoutBounds, bounds = this.getInnerBounds(type);
4490
4490
  switch (relative) {
4491
4491
  case 'world':
4492
4492
  point = leaf.getWorldPoint(bounds);
4493
4493
  matrix = leaf.__world;
4494
4494
  break;
4495
4495
  case 'local':
4496
+ const { scaleX, scaleY, rotation, skewX, skewY } = leaf.__;
4497
+ layoutBounds = { scaleX, scaleY, rotation, skewX, skewY };
4496
4498
  point = leaf.getLocalPointByInner(bounds);
4497
- matrix = leaf.__localMatrix;
4498
4499
  break;
4499
4500
  case 'inner':
4500
4501
  point = bounds;
@@ -4506,7 +4507,8 @@ var LeaferUI = (function (exports) {
4506
4507
  point = leaf.getWorldPoint(bounds, relative);
4507
4508
  matrix = getRelativeWorld$1(leaf, relative, true);
4508
4509
  }
4509
- const layoutBounds = MatrixHelper.getLayout(matrix);
4510
+ if (!layoutBounds)
4511
+ layoutBounds = MatrixHelper.getLayout(matrix);
4510
4512
  copy$6(layoutBounds, bounds);
4511
4513
  PointHelper.copy(layoutBounds, point);
4512
4514
  if (unscale) {
@@ -5917,7 +5919,7 @@ var LeaferUI = (function (exports) {
5917
5919
  }
5918
5920
  }
5919
5921
 
5920
- const version = "1.0.3";
5922
+ const version = "1.0.4";
5921
5923
 
5922
5924
  class LeaferCanvas extends LeaferCanvasBase {
5923
5925
  get allowBackgroundColor() { return true; }
@@ -7417,10 +7419,10 @@ var LeaferUI = (function (exports) {
7417
7419
  export(filename, options) {
7418
7420
  return Export.export(this, filename, options);
7419
7421
  }
7420
- clone(newData) {
7422
+ clone(data) {
7421
7423
  const json = this.toJSON();
7422
- if (newData)
7423
- Object.assign(json, newData);
7424
+ if (data)
7425
+ Object.assign(json, data);
7424
7426
  return UI_1.one(json);
7425
7427
  }
7426
7428
  static one(data, x, y, width, height) {