@onerjs/gui 8.31.3 → 8.31.5
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/2D/controls/control.d.ts
CHANGED
|
@@ -91,6 +91,8 @@ export declare class Control implements IAnimatable, IFocusableControl {
|
|
|
91
91
|
/** @internal */
|
|
92
92
|
_invertTransformMatrix: Matrix2D;
|
|
93
93
|
/** @internal */
|
|
94
|
+
_noRootTransformMatrix: Matrix2D;
|
|
95
|
+
/** @internal */
|
|
94
96
|
protected _transformedPosition: Vector2;
|
|
95
97
|
private _isMatrixDirty;
|
|
96
98
|
private _cachedOffsetX;
|
|
@@ -116,6 +118,8 @@ export declare class Control implements IAnimatable, IFocusableControl {
|
|
|
116
118
|
private _gradient;
|
|
117
119
|
/** @internal */
|
|
118
120
|
protected _rebuildLayout: boolean;
|
|
121
|
+
private _transformedMeasure;
|
|
122
|
+
isRoot: boolean;
|
|
119
123
|
/** @internal */
|
|
120
124
|
protected _urlRewriter?: (url: string) => string;
|
|
121
125
|
/**
|
package/2D/controls/control.js
CHANGED
|
@@ -30,7 +30,7 @@ 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.
|
|
33
|
+
return this._transformedMeasure;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Sets/Gets a boolean indicating if the children are clipped to the current control bounds.
|
|
@@ -968,6 +968,8 @@ export class Control {
|
|
|
968
968
|
/** @internal */
|
|
969
969
|
this._invertTransformMatrix = Matrix2D.Identity();
|
|
970
970
|
/** @internal */
|
|
971
|
+
this._noRootTransformMatrix = Matrix2D.Identity();
|
|
972
|
+
/** @internal */
|
|
971
973
|
this._transformedPosition = Vector2.Zero();
|
|
972
974
|
this._isMatrixDirty = true;
|
|
973
975
|
this._isVisible = true;
|
|
@@ -989,6 +991,8 @@ export class Control {
|
|
|
989
991
|
this._gradient = null;
|
|
990
992
|
/** @internal */
|
|
991
993
|
this._rebuildLayout = false;
|
|
994
|
+
this._transformedMeasure = Measure.Empty();
|
|
995
|
+
this.isRoot = false;
|
|
992
996
|
/**
|
|
993
997
|
* Observable that fires when the control's enabled state changes
|
|
994
998
|
*/
|
|
@@ -1451,9 +1455,11 @@ export class Control {
|
|
|
1451
1455
|
if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) {
|
|
1452
1456
|
return;
|
|
1453
1457
|
}
|
|
1458
|
+
const offsetW = this._currentMeasure.width * this._transformCenterX;
|
|
1459
|
+
const offsetH = this._currentMeasure.height * this._transformCenterY;
|
|
1454
1460
|
// postTranslate
|
|
1455
|
-
const offsetX =
|
|
1456
|
-
const offsetY =
|
|
1461
|
+
const offsetX = offsetW + this._currentMeasure.left;
|
|
1462
|
+
const offsetY = offsetH + this._currentMeasure.top;
|
|
1457
1463
|
if (context) {
|
|
1458
1464
|
context.translate(offsetX, offsetY);
|
|
1459
1465
|
// rotate
|
|
@@ -1470,8 +1476,15 @@ export class Control {
|
|
|
1470
1476
|
this._isMatrixDirty = false;
|
|
1471
1477
|
this._flagDescendantsAsMatrixDirty();
|
|
1472
1478
|
Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix);
|
|
1479
|
+
if (this.isRoot) {
|
|
1480
|
+
Matrix2D.ComposeToRef(-offsetX, -offsetY, 0, 1, 1, null, this._noRootTransformMatrix);
|
|
1481
|
+
}
|
|
1482
|
+
else {
|
|
1483
|
+
Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._noRootTransformMatrix : null, this._noRootTransformMatrix);
|
|
1484
|
+
}
|
|
1473
1485
|
this._transformMatrix.invertToRef(this._invertTransformMatrix);
|
|
1474
1486
|
this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
|
|
1487
|
+
this._currentMeasure.transformToRef(this._noRootTransformMatrix, this._transformedMeasure);
|
|
1475
1488
|
}
|
|
1476
1489
|
}
|
|
1477
1490
|
/**
|