leafer-draw 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/web.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$5(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
  const debug$5 = Debug.get('LeaferCanvas');
5923
5925
  class LeaferCanvas extends LeaferCanvasBase {
@@ -7319,10 +7321,10 @@ var LeaferUI = (function (exports) {
7319
7321
  export(filename, options) {
7320
7322
  return Export.export(this, filename, options);
7321
7323
  }
7322
- clone(newData) {
7324
+ clone(data) {
7323
7325
  const json = this.toJSON();
7324
- if (newData)
7325
- Object.assign(json, newData);
7326
+ if (data)
7327
+ Object.assign(json, data);
7326
7328
  return UI_1.one(json);
7327
7329
  }
7328
7330
  static one(data, x, y, width, height) {