@onerjs/gui 8.31.4 → 8.31.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.
@@ -91,6 +91,10 @@ export declare class Control implements IAnimatable, IFocusableControl {
91
91
  /** @internal */
92
92
  _invertTransformMatrix: Matrix2D;
93
93
  /** @internal */
94
+ _noRootTransformMatrix: Matrix2D;
95
+ /** @internal */
96
+ _selfTransformMatrix: Matrix2D;
97
+ /** @internal */
94
98
  protected _transformedPosition: Vector2;
95
99
  private _isMatrixDirty;
96
100
  private _cachedOffsetX;
@@ -116,6 +120,9 @@ export declare class Control implements IAnimatable, IFocusableControl {
116
120
  private _gradient;
117
121
  /** @internal */
118
122
  protected _rebuildLayout: boolean;
123
+ private _transformedMeasure;
124
+ private _selfTransformedMeasure;
125
+ /** @internal */
119
126
  isRoot: boolean;
120
127
  /** @internal */
121
128
  protected _urlRewriter?: (url: string) => string;
@@ -149,6 +156,10 @@ export declare class Control implements IAnimatable, IFocusableControl {
149
156
  * Gets the transformed measure, that is the bounding box of the control after applying all transformations
150
157
  */
151
158
  get transformedMeasure(): Measure;
159
+ /**
160
+ * Gets the transformed measure, that is the bounding box of the control after applying self transformations
161
+ */
162
+ get selfTransformedMeasure(): Measure;
152
163
  /**
153
164
  * Gets or sets an object used to store user defined information for the node
154
165
  */
@@ -30,7 +30,13 @@ export class Control {
30
30
  * Gets the transformed measure, that is the bounding box of the control after applying all transformations
31
31
  */
32
32
  get transformedMeasure() {
33
- return this._evaluatedMeasure;
33
+ return this._transformedMeasure;
34
+ }
35
+ /**
36
+ * Gets the transformed measure, that is the bounding box of the control after applying self transformations
37
+ */
38
+ get selfTransformedMeasure() {
39
+ return this._selfTransformedMeasure;
34
40
  }
35
41
  /**
36
42
  * Sets/Gets a boolean indicating if the children are clipped to the current control bounds.
@@ -967,14 +973,10 @@ export class Control {
967
973
  this._transformMatrix = Matrix2D.Identity();
968
974
  /** @internal */
969
975
  this._invertTransformMatrix = Matrix2D.Identity();
970
- // /** @internal */
971
- // public _transformMatrix2 = Matrix2D.Identity();
972
- // /** @internal */
973
- // public _invertTransformMatrix2 = Matrix2D.Identity();
974
- // /** @internal */
975
- // private _cachedOffsetX2: number;
976
- // /** @internal */
977
- // private _cachedOffsetY2: number;
976
+ /** @internal */
977
+ this._noRootTransformMatrix = Matrix2D.Identity();
978
+ /** @internal */
979
+ this._selfTransformMatrix = Matrix2D.Identity();
978
980
  /** @internal */
979
981
  this._transformedPosition = Vector2.Zero();
980
982
  this._isMatrixDirty = true;
@@ -997,6 +999,9 @@ export class Control {
997
999
  this._gradient = null;
998
1000
  /** @internal */
999
1001
  this._rebuildLayout = false;
1002
+ this._transformedMeasure = Measure.Empty();
1003
+ this._selfTransformedMeasure = Measure.Empty();
1004
+ /** @internal */
1000
1005
  this.isRoot = false;
1001
1006
  /**
1002
1007
  * Observable that fires when the control's enabled state changes
@@ -1480,9 +1485,18 @@ export class Control {
1480
1485
  this._cachedOffsetY = offsetY;
1481
1486
  this._isMatrixDirty = false;
1482
1487
  this._flagDescendantsAsMatrixDirty();
1483
- Matrix2D.ComposeToRef(-offsetX, -offsetY, this.isRoot ? 0 : this._rotation, this.isRoot ? 1 : this._scaleX, this.isRoot ? 1 : this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix);
1488
+ Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix);
1489
+ Matrix2D.ComposeToRef(-offsetX, -offsetY, this.rotation, this.scaleX, this.scaleY, null, this._selfTransformMatrix);
1490
+ if (this.isRoot) {
1491
+ Matrix2D.ComposeToRef(-offsetX, -offsetY, 0, 1, 1, null, this._noRootTransformMatrix);
1492
+ }
1493
+ else {
1494
+ Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._noRootTransformMatrix : null, this._noRootTransformMatrix);
1495
+ }
1484
1496
  this._transformMatrix.invertToRef(this._invertTransformMatrix);
1485
1497
  this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
1498
+ this._currentMeasure.transformToRef(this._noRootTransformMatrix, this._transformedMeasure);
1499
+ this._currentMeasure.transformToRef(this._selfTransformMatrix, this._selfTransformedMeasure);
1486
1500
  }
1487
1501
  }
1488
1502
  /**