@onerjs/gui 8.31.2 → 8.31.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.
@@ -89,7 +89,7 @@ export declare class Control implements IAnimatable, IFocusableControl {
89
89
  /** @internal */
90
90
  _transformMatrix: Matrix2D;
91
91
  /** @internal */
92
- protected _invertTransformMatrix: Matrix2D;
92
+ _invertTransformMatrix: Matrix2D;
93
93
  /** @internal */
94
94
  protected _transformedPosition: Vector2;
95
95
  private _isMatrixDirty;
@@ -116,6 +116,7 @@ export declare class Control implements IAnimatable, IFocusableControl {
116
116
  private _gradient;
117
117
  /** @internal */
118
118
  protected _rebuildLayout: boolean;
119
+ isRoot: boolean;
119
120
  /** @internal */
120
121
  protected _urlRewriter?: (url: string) => string;
121
122
  /**
@@ -967,6 +967,14 @@ export class Control {
967
967
  this._transformMatrix = Matrix2D.Identity();
968
968
  /** @internal */
969
969
  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;
970
978
  /** @internal */
971
979
  this._transformedPosition = Vector2.Zero();
972
980
  this._isMatrixDirty = true;
@@ -989,6 +997,7 @@ export class Control {
989
997
  this._gradient = null;
990
998
  /** @internal */
991
999
  this._rebuildLayout = false;
1000
+ this.isRoot = false;
992
1001
  /**
993
1002
  * Observable that fires when the control's enabled state changes
994
1003
  */
@@ -1451,9 +1460,11 @@ export class Control {
1451
1460
  if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) {
1452
1461
  return;
1453
1462
  }
1463
+ const offsetW = this._currentMeasure.width * this._transformCenterX;
1464
+ const offsetH = this._currentMeasure.height * this._transformCenterY;
1454
1465
  // postTranslate
1455
- const offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left;
1456
- const offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top;
1466
+ const offsetX = offsetW + this._currentMeasure.left;
1467
+ const offsetY = offsetH + this._currentMeasure.top;
1457
1468
  if (context) {
1458
1469
  context.translate(offsetX, offsetY);
1459
1470
  // rotate
@@ -1469,7 +1480,7 @@ export class Control {
1469
1480
  this._cachedOffsetY = offsetY;
1470
1481
  this._isMatrixDirty = false;
1471
1482
  this._flagDescendantsAsMatrixDirty();
1472
- Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix);
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);
1473
1484
  this._transformMatrix.invertToRef(this._invertTransformMatrix);
1474
1485
  this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
1475
1486
  }