@babylonjs/gui 5.20.0 → 5.22.1

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.
Files changed (178) hide show
  1. package/2D/adtInstrumentation.js +70 -90
  2. package/2D/adtInstrumentation.js.map +1 -1
  3. package/2D/advancedDynamicTexture.d.ts +14 -0
  4. package/2D/advancedDynamicTexture.js +574 -620
  5. package/2D/advancedDynamicTexture.js.map +1 -1
  6. package/2D/controls/button.js +76 -90
  7. package/2D/controls/button.js.map +1 -1
  8. package/2D/controls/checkbox.js +86 -106
  9. package/2D/controls/checkbox.js.map +1 -1
  10. package/2D/controls/colorpicker.js +395 -415
  11. package/2D/controls/colorpicker.js.map +1 -1
  12. package/2D/controls/container.js +187 -230
  13. package/2D/controls/container.js.map +1 -1
  14. package/2D/controls/control.js +1073 -1353
  15. package/2D/controls/control.js.map +1 -1
  16. package/2D/controls/displayGrid.js +152 -196
  17. package/2D/controls/displayGrid.js.map +1 -1
  18. package/2D/controls/ellipse.js +32 -40
  19. package/2D/controls/ellipse.js.map +1 -1
  20. package/2D/controls/focusableButton.js +30 -35
  21. package/2D/controls/focusableButton.js.map +1 -1
  22. package/2D/controls/grid.js +172 -212
  23. package/2D/controls/grid.js.map +1 -1
  24. package/2D/controls/image.js +489 -592
  25. package/2D/controls/image.js.map +1 -1
  26. package/2D/controls/inputPassword.js +9 -16
  27. package/2D/controls/inputPassword.js.map +1 -1
  28. package/2D/controls/inputText.js +380 -467
  29. package/2D/controls/inputText.js.map +1 -1
  30. package/2D/controls/inputTextArea.js +234 -273
  31. package/2D/controls/inputTextArea.js.map +1 -1
  32. package/2D/controls/line.js +147 -198
  33. package/2D/controls/line.js.map +1 -1
  34. package/2D/controls/multiLine.js +87 -113
  35. package/2D/controls/multiLine.js.map +1 -1
  36. package/2D/controls/radioButton.js +106 -127
  37. package/2D/controls/radioButton.js.map +1 -1
  38. package/2D/controls/rectangle.js +60 -72
  39. package/2D/controls/rectangle.js.map +1 -1
  40. package/2D/controls/scrollViewers/scrollViewer.js +439 -543
  41. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  42. package/2D/controls/scrollViewers/scrollViewerWindow.js +99 -118
  43. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  44. package/2D/controls/selector.js +241 -329
  45. package/2D/controls/selector.js.map +1 -1
  46. package/2D/controls/sliders/baseSlider.js +182 -230
  47. package/2D/controls/sliders/baseSlider.js.map +1 -1
  48. package/2D/controls/sliders/imageBasedSlider.js +86 -109
  49. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  50. package/2D/controls/sliders/imageScrollBar.js +148 -178
  51. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  52. package/2D/controls/sliders/scrollBar.js +64 -80
  53. package/2D/controls/sliders/scrollBar.js.map +1 -1
  54. package/2D/controls/sliders/slider.js +91 -115
  55. package/2D/controls/sliders/slider.js.map +1 -1
  56. package/2D/controls/stackPanel.js +114 -135
  57. package/2D/controls/stackPanel.js.map +1 -1
  58. package/2D/controls/statics.js +5 -5
  59. package/2D/controls/statics.js.map +1 -1
  60. package/2D/controls/textBlock.js +322 -384
  61. package/2D/controls/textBlock.js.map +1 -1
  62. package/2D/controls/textWrapper.js +27 -41
  63. package/2D/controls/textWrapper.js.map +1 -1
  64. package/2D/controls/toggleButton.js +105 -121
  65. package/2D/controls/toggleButton.js.map +1 -1
  66. package/2D/controls/virtualKeyboard.js +101 -123
  67. package/2D/controls/virtualKeyboard.js.map +1 -1
  68. package/2D/math2D.js +62 -70
  69. package/2D/math2D.js.map +1 -1
  70. package/2D/measure.js +30 -32
  71. package/2D/measure.js.map +1 -1
  72. package/2D/multiLinePoint.js +71 -89
  73. package/2D/multiLinePoint.js.map +1 -1
  74. package/2D/style.js +55 -73
  75. package/2D/style.js.map +1 -1
  76. package/2D/valueAndUnit.js +71 -104
  77. package/2D/valueAndUnit.js.map +1 -1
  78. package/2D/xmlLoader.js +70 -84
  79. package/2D/xmlLoader.js.map +1 -1
  80. package/3D/behaviors/defaultBehavior.js +40 -59
  81. package/3D/behaviors/defaultBehavior.js.map +1 -1
  82. package/3D/controls/abstractButton3D.js +8 -12
  83. package/3D/controls/abstractButton3D.js.map +1 -1
  84. package/3D/controls/button3D.js +30 -35
  85. package/3D/controls/button3D.js.map +1 -1
  86. package/3D/controls/container3D.js +57 -71
  87. package/3D/controls/container3D.js.map +1 -1
  88. package/3D/controls/contentDisplay3D.js +47 -60
  89. package/3D/controls/contentDisplay3D.js.map +1 -1
  90. package/3D/controls/control3D.js +123 -158
  91. package/3D/controls/control3D.js.map +1 -1
  92. package/3D/controls/cylinderPanel.js +28 -38
  93. package/3D/controls/cylinderPanel.js.map +1 -1
  94. package/3D/controls/handMenu.js +20 -29
  95. package/3D/controls/handMenu.js.map +1 -1
  96. package/3D/controls/holographicBackplate.js +52 -72
  97. package/3D/controls/holographicBackplate.js.map +1 -1
  98. package/3D/controls/holographicButton.js +160 -200
  99. package/3D/controls/holographicButton.js.map +1 -1
  100. package/3D/controls/holographicSlate.js +176 -206
  101. package/3D/controls/holographicSlate.js.map +1 -1
  102. package/3D/controls/meshButton3D.js +24 -30
  103. package/3D/controls/meshButton3D.js.map +1 -1
  104. package/3D/controls/nearMenu.js +57 -71
  105. package/3D/controls/nearMenu.js.map +1 -1
  106. package/3D/controls/planePanel.js +6 -13
  107. package/3D/controls/planePanel.js.map +1 -1
  108. package/3D/controls/scatterPanel.js +43 -54
  109. package/3D/controls/scatterPanel.js.map +1 -1
  110. package/3D/controls/slider3D.js +168 -222
  111. package/3D/controls/slider3D.js.map +1 -1
  112. package/3D/controls/spherePanel.js +29 -39
  113. package/3D/controls/spherePanel.js.map +1 -1
  114. package/3D/controls/stackPanel3D.js +36 -49
  115. package/3D/controls/stackPanel3D.js.map +1 -1
  116. package/3D/controls/touchButton3D.js +126 -154
  117. package/3D/controls/touchButton3D.js.map +1 -1
  118. package/3D/controls/touchHolographicButton.js +223 -272
  119. package/3D/controls/touchHolographicButton.js.map +1 -1
  120. package/3D/controls/touchHolographicMenu.js +55 -66
  121. package/3D/controls/touchHolographicMenu.js.map +1 -1
  122. package/3D/controls/touchMeshButton3D.js +24 -30
  123. package/3D/controls/touchMeshButton3D.js.map +1 -1
  124. package/3D/controls/volumeBasedPanel.js +85 -107
  125. package/3D/controls/volumeBasedPanel.js.map +1 -1
  126. package/3D/gizmos/gizmoHandle.js +68 -103
  127. package/3D/gizmos/gizmoHandle.js.map +1 -1
  128. package/3D/gizmos/slateGizmo.js +165 -182
  129. package/3D/gizmos/slateGizmo.js.map +1 -1
  130. package/3D/gui3DManager.js +76 -101
  131. package/3D/gui3DManager.js.map +1 -1
  132. package/3D/materials/fluent/fluentMaterial.js +110 -119
  133. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  134. package/3D/materials/fluent/shaders/fluent.fragment.js +20 -3
  135. package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
  136. package/3D/materials/fluent/shaders/fluent.vertex.js +11 -3
  137. package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
  138. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +168 -177
  139. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  140. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +9 -3
  141. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
  142. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +15 -3
  143. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
  144. package/3D/materials/fluentButton/fluentButtonMaterial.js +205 -213
  145. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  146. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +6 -3
  147. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
  148. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +6 -3
  149. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
  150. package/3D/materials/handle/handleMaterial.js +56 -69
  151. package/3D/materials/handle/handleMaterial.js.map +1 -1
  152. package/3D/materials/handle/shaders/handle.fragment.js +3 -3
  153. package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
  154. package/3D/materials/handle/shaders/handle.vertex.js +3 -3
  155. package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
  156. package/3D/materials/mrdl/mrdlBackplateMaterial.js +158 -166
  157. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  158. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +322 -330
  159. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  160. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +322 -330
  161. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  162. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +9 -3
  163. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
  164. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +6 -3
  165. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
  166. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +24 -3
  167. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
  168. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +12 -3
  169. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
  170. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +24 -3
  171. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
  172. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +12 -3
  173. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
  174. package/3D/vector3WithInfo.js +6 -12
  175. package/3D/vector3WithInfo.js.map +1 -1
  176. package/legacy/legacy.js +1 -1
  177. package/legacy/legacy.js.map +1 -1
  178. package/package.json +3 -6
package/2D/math2D.js CHANGED
@@ -1,29 +1,23 @@
1
- import { __extends } from "tslib";
2
1
  import { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
3
2
  import { Epsilon } from "@babylonjs/core/Maths/math.constants.js";
4
3
  /**
5
4
  * Class used to transport Vector2 information for pointer events
6
5
  */
7
- var Vector2WithInfo = /** @class */ (function (_super) {
8
- __extends(Vector2WithInfo, _super);
6
+ export class Vector2WithInfo extends Vector2 {
9
7
  /**
10
8
  * Creates a new Vector2WithInfo
11
9
  * @param source defines the vector2 data to transport
12
10
  * @param buttonIndex defines the current mouse button index
13
11
  */
14
- function Vector2WithInfo(source,
12
+ constructor(source,
15
13
  /** defines the current mouse button index */
16
- buttonIndex) {
17
- if (buttonIndex === void 0) { buttonIndex = 0; }
18
- var _this = _super.call(this, source.x, source.y) || this;
19
- _this.buttonIndex = buttonIndex;
20
- return _this;
14
+ buttonIndex = 0) {
15
+ super(source.x, source.y);
16
+ this.buttonIndex = buttonIndex;
21
17
  }
22
- return Vector2WithInfo;
23
- }(Vector2));
24
- export { Vector2WithInfo };
18
+ }
25
19
  /** Class used to provide 2D matrix features */
26
- var Matrix2D = /** @class */ (function () {
20
+ export class Matrix2D {
27
21
  /**
28
22
  * Creates a new matrix
29
23
  * @param m00 defines value for (0, 0)
@@ -33,7 +27,7 @@ var Matrix2D = /** @class */ (function () {
33
27
  * @param m20 defines value for (2, 0)
34
28
  * @param m21 defines value for (2, 1)
35
29
  */
36
- function Matrix2D(m00, m01, m10, m11, m20, m21) {
30
+ constructor(m00, m01, m10, m11, m20, m21) {
37
31
  /** Gets the internal array of 6 floats used to store matrix data */
38
32
  this.m = new Float32Array(6);
39
33
  this.fromValues(m00, m01, m10, m11, m20, m21);
@@ -48,7 +42,7 @@ var Matrix2D = /** @class */ (function () {
48
42
  * @param m21 defines value for (2, 1)
49
43
  * @returns the current modified matrix
50
44
  */
51
- Matrix2D.prototype.fromValues = function (m00, m01, m10, m11, m20, m21) {
45
+ fromValues(m00, m01, m10, m11, m20, m21) {
52
46
  this.m[0] = m00;
53
47
  this.m[1] = m01;
54
48
  this.m[2] = m10;
@@ -56,27 +50,27 @@ var Matrix2D = /** @class */ (function () {
56
50
  this.m[4] = m20;
57
51
  this.m[5] = m21;
58
52
  return this;
59
- };
53
+ }
60
54
  /**
61
55
  * Gets matrix determinant
62
56
  * @returns the determinant
63
57
  */
64
- Matrix2D.prototype.determinant = function () {
58
+ determinant() {
65
59
  return this.m[0] * this.m[3] - this.m[1] * this.m[2];
66
- };
60
+ }
67
61
  /**
68
62
  * Inverses the matrix and stores it in a target matrix
69
63
  * @param result defines the target matrix
70
64
  * @returns the current matrix
71
65
  */
72
- Matrix2D.prototype.invertToRef = function (result) {
73
- var l0 = this.m[0];
74
- var l1 = this.m[1];
75
- var l2 = this.m[2];
76
- var l3 = this.m[3];
77
- var l4 = this.m[4];
78
- var l5 = this.m[5];
79
- var det = this.determinant();
66
+ invertToRef(result) {
67
+ const l0 = this.m[0];
68
+ const l1 = this.m[1];
69
+ const l2 = this.m[2];
70
+ const l3 = this.m[3];
71
+ const l4 = this.m[4];
72
+ const l5 = this.m[5];
73
+ const det = this.determinant();
80
74
  if (det < Epsilon * Epsilon) {
81
75
  result.m[0] = 0;
82
76
  result.m[1] = 0;
@@ -86,9 +80,9 @@ var Matrix2D = /** @class */ (function () {
86
80
  result.m[5] = 0;
87
81
  return this;
88
82
  }
89
- var detDiv = 1 / det;
90
- var det4 = l2 * l5 - l3 * l4;
91
- var det5 = l1 * l4 - l0 * l5;
83
+ const detDiv = 1 / det;
84
+ const det4 = l2 * l5 - l3 * l4;
85
+ const det5 = l1 * l4 - l0 * l5;
92
86
  result.m[0] = l3 * detDiv;
93
87
  result.m[1] = -l1 * detDiv;
94
88
  result.m[2] = -l2 * detDiv;
@@ -96,26 +90,26 @@ var Matrix2D = /** @class */ (function () {
96
90
  result.m[4] = det4 * detDiv;
97
91
  result.m[5] = det5 * detDiv;
98
92
  return this;
99
- };
93
+ }
100
94
  /**
101
95
  * Multiplies the current matrix with another one
102
96
  * @param other defines the second operand
103
97
  * @param result defines the target matrix
104
98
  * @returns the current matrix
105
99
  */
106
- Matrix2D.prototype.multiplyToRef = function (other, result) {
107
- var l0 = this.m[0];
108
- var l1 = this.m[1];
109
- var l2 = this.m[2];
110
- var l3 = this.m[3];
111
- var l4 = this.m[4];
112
- var l5 = this.m[5];
113
- var r0 = other.m[0];
114
- var r1 = other.m[1];
115
- var r2 = other.m[2];
116
- var r3 = other.m[3];
117
- var r4 = other.m[4];
118
- var r5 = other.m[5];
100
+ multiplyToRef(other, result) {
101
+ const l0 = this.m[0];
102
+ const l1 = this.m[1];
103
+ const l2 = this.m[2];
104
+ const l3 = this.m[3];
105
+ const l4 = this.m[4];
106
+ const l5 = this.m[5];
107
+ const r0 = other.m[0];
108
+ const r1 = other.m[1];
109
+ const r2 = other.m[2];
110
+ const r3 = other.m[3];
111
+ const r4 = other.m[4];
112
+ const r5 = other.m[5];
119
113
  result.m[0] = l0 * r0 + l1 * r2;
120
114
  result.m[1] = l0 * r1 + l1 * r3;
121
115
  result.m[2] = l2 * r0 + l3 * r2;
@@ -123,7 +117,7 @@ var Matrix2D = /** @class */ (function () {
123
117
  result.m[4] = l4 * r0 + l5 * r2 + r4;
124
118
  result.m[5] = l4 * r1 + l5 * r3 + r5;
125
119
  return this;
126
- };
120
+ }
127
121
  /**
128
122
  * Applies the current matrix to a set of 2 floats and stores the result in a vector2
129
123
  * @param x defines the x coordinate to transform
@@ -131,59 +125,59 @@ var Matrix2D = /** @class */ (function () {
131
125
  * @param result defines the target vector2
132
126
  * @returns the current matrix
133
127
  */
134
- Matrix2D.prototype.transformCoordinates = function (x, y, result) {
128
+ transformCoordinates(x, y, result) {
135
129
  result.x = x * this.m[0] + y * this.m[2] + this.m[4];
136
130
  result.y = x * this.m[1] + y * this.m[3] + this.m[5];
137
131
  return this;
138
- };
132
+ }
139
133
  // Statics
140
134
  /**
141
135
  * Creates an identity matrix
142
136
  * @returns a new matrix
143
137
  */
144
- Matrix2D.Identity = function () {
138
+ static Identity() {
145
139
  return new Matrix2D(1, 0, 0, 1, 0, 0);
146
- };
140
+ }
147
141
  /**
148
142
  * Creates an identity matrix and stores it in a target matrix
149
143
  * @param result defines the target matrix
150
144
  */
151
- Matrix2D.IdentityToRef = function (result) {
145
+ static IdentityToRef(result) {
152
146
  result.m[0] = 1;
153
147
  result.m[1] = 0;
154
148
  result.m[2] = 0;
155
149
  result.m[3] = 1;
156
150
  result.m[4] = 0;
157
151
  result.m[5] = 0;
158
- };
152
+ }
159
153
  /**
160
154
  * Creates a translation matrix and stores it in a target matrix
161
155
  * @param x defines the x coordinate of the translation
162
156
  * @param y defines the y coordinate of the translation
163
157
  * @param result defines the target matrix
164
158
  */
165
- Matrix2D.TranslationToRef = function (x, y, result) {
159
+ static TranslationToRef(x, y, result) {
166
160
  result.fromValues(1, 0, 0, 1, x, y);
167
- };
161
+ }
168
162
  /**
169
163
  * Creates a scaling matrix and stores it in a target matrix
170
164
  * @param x defines the x coordinate of the scaling
171
165
  * @param y defines the y coordinate of the scaling
172
166
  * @param result defines the target matrix
173
167
  */
174
- Matrix2D.ScalingToRef = function (x, y, result) {
168
+ static ScalingToRef(x, y, result) {
175
169
  result.fromValues(x, 0, 0, y, 0, 0);
176
- };
170
+ }
177
171
  /**
178
172
  * Creates a rotation matrix and stores it in a target matrix
179
173
  * @param angle defines the rotation angle
180
174
  * @param result defines the target matrix
181
175
  */
182
- Matrix2D.RotationToRef = function (angle, result) {
183
- var s = Math.sin(angle);
184
- var c = Math.cos(angle);
176
+ static RotationToRef(angle, result) {
177
+ const s = Math.sin(angle);
178
+ const c = Math.cos(angle);
185
179
  result.fromValues(c, s, -s, c, 0, 0);
186
- };
180
+ }
187
181
  /**
188
182
  * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
189
183
  * @param tx defines the x coordinate of the translation
@@ -194,7 +188,7 @@ var Matrix2D = /** @class */ (function () {
194
188
  * @param parentMatrix defines the parent matrix to multiply by (can be null)
195
189
  * @param result defines the target matrix
196
190
  */
197
- Matrix2D.ComposeToRef = function (tx, ty, angle, scaleX, scaleY, parentMatrix, result) {
191
+ static ComposeToRef(tx, ty, angle, scaleX, scaleY, parentMatrix, result) {
198
192
  Matrix2D.TranslationToRef(tx, ty, Matrix2D._TempPreTranslationMatrix);
199
193
  Matrix2D.ScalingToRef(scaleX, scaleY, Matrix2D._TempScalingMatrix);
200
194
  Matrix2D.RotationToRef(angle, Matrix2D._TempRotationMatrix);
@@ -208,15 +202,13 @@ var Matrix2D = /** @class */ (function () {
208
202
  else {
209
203
  Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, result);
210
204
  }
211
- };
212
- Matrix2D._TempPreTranslationMatrix = Matrix2D.Identity();
213
- Matrix2D._TempPostTranslationMatrix = Matrix2D.Identity();
214
- Matrix2D._TempRotationMatrix = Matrix2D.Identity();
215
- Matrix2D._TempScalingMatrix = Matrix2D.Identity();
216
- Matrix2D._TempCompose0 = Matrix2D.Identity();
217
- Matrix2D._TempCompose1 = Matrix2D.Identity();
218
- Matrix2D._TempCompose2 = Matrix2D.Identity();
219
- return Matrix2D;
220
- }());
221
- export { Matrix2D };
205
+ }
206
+ }
207
+ Matrix2D._TempPreTranslationMatrix = Matrix2D.Identity();
208
+ Matrix2D._TempPostTranslationMatrix = Matrix2D.Identity();
209
+ Matrix2D._TempRotationMatrix = Matrix2D.Identity();
210
+ Matrix2D._TempScalingMatrix = Matrix2D.Identity();
211
+ Matrix2D._TempCompose0 = Matrix2D.Identity();
212
+ Matrix2D._TempCompose1 = Matrix2D.Identity();
213
+ Matrix2D._TempCompose2 = Matrix2D.Identity();
222
214
  //# sourceMappingURL=math2D.js.map
package/2D/math2D.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"math2D.js","sourceRoot":"","sources":["../../../../../lts/gui/generated/2D/math2D.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE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CAAC;IACjD,4BAAmB,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC1C,2BAAkB,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IACzC,sBAAa,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IACpC,sBAAa,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IACpC,sBAAa,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IA8BvD,eAAC;CAAA,AA3ND,IA2NC;SA3NY,QAAQ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { Epsilon } from \"core/Maths/math.constants\";\r\n\r\n/**\r\n * Class used to transport Vector2 information for pointer events\r\n */\r\nexport class Vector2WithInfo extends Vector2 {\r\n /**\r\n * Creates a new Vector2WithInfo\r\n * @param source defines the vector2 data to transport\r\n * @param buttonIndex defines the current mouse button index\r\n */\r\n public constructor(\r\n source: Vector2,\r\n /** defines the current mouse button index */\r\n public buttonIndex: number = 0\r\n ) {\r\n super(source.x, source.y);\r\n }\r\n}\r\n\r\n/** Class used to provide 2D matrix features */\r\nexport class Matrix2D {\r\n /** Gets the internal array of 6 floats used to store matrix data */\r\n public m = new Float32Array(6);\r\n\r\n /**\r\n * Creates a new matrix\r\n * @param m00 defines value for (0, 0)\r\n * @param m01 defines value for (0, 1)\r\n * @param m10 defines value for (1, 0)\r\n * @param m11 defines value for (1, 1)\r\n * @param m20 defines value for (2, 0)\r\n * @param m21 defines value for (2, 1)\r\n */\r\n constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number) {\r\n this.fromValues(m00, m01, m10, m11, m20, m21);\r\n }\r\n\r\n /**\r\n * Fills the matrix from direct values\r\n * @param m00 defines value for (0, 0)\r\n * @param m01 defines value for (0, 1)\r\n * @param m10 defines value for (1, 0)\r\n * @param m11 defines value for (1, 1)\r\n * @param m20 defines value for (2, 0)\r\n * @param m21 defines value for (2, 1)\r\n * @returns the current modified matrix\r\n */\r\n public fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D {\r\n this.m[0] = m00;\r\n this.m[1] = m01;\r\n this.m[2] = m10;\r\n this.m[3] = m11;\r\n this.m[4] = m20;\r\n this.m[5] = m21;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets matrix determinant\r\n * @returns the determinant\r\n */\r\n public determinant(): number {\r\n return this.m[0] * this.m[3] - this.m[1] * this.m[2];\r\n }\r\n\r\n /**\r\n * Inverses the matrix and stores it in a target matrix\r\n * @param result defines the target matrix\r\n * @returns the current matrix\r\n */\r\n public invertToRef(result: Matrix2D): Matrix2D {\r\n const l0 = this.m[0];\r\n const l1 = this.m[1];\r\n const l2 = this.m[2];\r\n const l3 = this.m[3];\r\n const l4 = this.m[4];\r\n const l5 = this.m[5];\r\n\r\n const det = this.determinant();\r\n if (det < Epsilon * Epsilon) {\r\n result.m[0] = 0;\r\n result.m[1] = 0;\r\n result.m[2] = 0;\r\n result.m[3] = 0;\r\n result.m[4] = 0;\r\n result.m[5] = 0;\r\n return this;\r\n }\r\n\r\n const detDiv = 1 / det;\r\n\r\n const det4 = l2 * l5 - l3 * l4;\r\n const det5 = l1 * l4 - l0 * l5;\r\n\r\n result.m[0] = l3 * detDiv;\r\n result.m[1] = -l1 * detDiv;\r\n result.m[2] = -l2 * detDiv;\r\n result.m[3] = l0 * detDiv;\r\n result.m[4] = det4 * detDiv;\r\n result.m[5] = det5 * detDiv;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies the current matrix with another one\r\n * @param other defines the second operand\r\n * @param result defines the target matrix\r\n * @returns the current matrix\r\n */\r\n public multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D {\r\n const l0 = this.m[0];\r\n const l1 = this.m[1];\r\n const l2 = this.m[2];\r\n const l3 = this.m[3];\r\n const l4 = this.m[4];\r\n const l5 = this.m[5];\r\n\r\n const r0 = other.m[0];\r\n const r1 = other.m[1];\r\n const r2 = other.m[2];\r\n const r3 = other.m[3];\r\n const r4 = other.m[4];\r\n const r5 = other.m[5];\r\n\r\n result.m[0] = l0 * r0 + l1 * r2;\r\n result.m[1] = l0 * r1 + l1 * r3;\r\n result.m[2] = l2 * r0 + l3 * r2;\r\n result.m[3] = l2 * r1 + l3 * r3;\r\n result.m[4] = l4 * r0 + l5 * r2 + r4;\r\n result.m[5] = l4 * r1 + l5 * r3 + r5;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Applies the current matrix to a set of 2 floats and stores the result in a vector2\r\n * @param x defines the x coordinate to transform\r\n * @param y defines the x coordinate to transform\r\n * @param result defines the target vector2\r\n * @returns the current matrix\r\n */\r\n public transformCoordinates(x: number, y: number, result: Vector2): Matrix2D {\r\n result.x = x * this.m[0] + y * this.m[2] + this.m[4];\r\n result.y = x * this.m[1] + y * this.m[3] + this.m[5];\r\n\r\n return this;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Creates an identity matrix\r\n * @returns a new matrix\r\n */\r\n public static Identity(): Matrix2D {\r\n return new Matrix2D(1, 0, 0, 1, 0, 0);\r\n }\r\n\r\n /**\r\n * Creates an identity matrix and stores it in a target matrix\r\n * @param result defines the target matrix\r\n */\r\n public static IdentityToRef(result: Matrix2D): void {\r\n result.m[0] = 1;\r\n result.m[1] = 0;\r\n result.m[2] = 0;\r\n result.m[3] = 1;\r\n result.m[4] = 0;\r\n result.m[5] = 0;\r\n }\r\n\r\n /**\r\n * Creates a translation matrix and stores it in a target matrix\r\n * @param x defines the x coordinate of the translation\r\n * @param y defines the y coordinate of the translation\r\n * @param result defines the target matrix\r\n */\r\n public static TranslationToRef(x: number, y: number, result: Matrix2D): void {\r\n result.fromValues(1, 0, 0, 1, x, y);\r\n }\r\n\r\n /**\r\n * Creates a scaling matrix and stores it in a target matrix\r\n * @param x defines the x coordinate of the scaling\r\n * @param y defines the y coordinate of the scaling\r\n * @param result defines the target matrix\r\n */\r\n public static ScalingToRef(x: number, y: number, result: Matrix2D): void {\r\n result.fromValues(x, 0, 0, y, 0, 0);\r\n }\r\n\r\n /**\r\n * Creates a rotation matrix and stores it in a target matrix\r\n * @param angle defines the rotation angle\r\n * @param result defines the target matrix\r\n */\r\n public static RotationToRef(angle: number, result: Matrix2D): void {\r\n const s = Math.sin(angle);\r\n const c = Math.cos(angle);\r\n\r\n result.fromValues(c, s, -s, c, 0, 0);\r\n }\r\n\r\n private static _TempPreTranslationMatrix = Matrix2D.Identity();\r\n private static _TempPostTranslationMatrix = Matrix2D.Identity();\r\n private static _TempRotationMatrix = Matrix2D.Identity();\r\n private static _TempScalingMatrix = Matrix2D.Identity();\r\n private static _TempCompose0 = Matrix2D.Identity();\r\n private static _TempCompose1 = Matrix2D.Identity();\r\n private static _TempCompose2 = Matrix2D.Identity();\r\n\r\n /**\r\n * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix\r\n * @param tx defines the x coordinate of the translation\r\n * @param ty defines the y coordinate of the translation\r\n * @param angle defines the rotation angle\r\n * @param scaleX defines the x coordinate of the scaling\r\n * @param scaleY defines the y coordinate of the scaling\r\n * @param parentMatrix defines the parent matrix to multiply by (can be null)\r\n * @param result defines the target matrix\r\n */\r\n public static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void {\r\n Matrix2D.TranslationToRef(tx, ty, Matrix2D._TempPreTranslationMatrix);\r\n\r\n Matrix2D.ScalingToRef(scaleX, scaleY, Matrix2D._TempScalingMatrix);\r\n\r\n Matrix2D.RotationToRef(angle, Matrix2D._TempRotationMatrix);\r\n\r\n Matrix2D.TranslationToRef(-tx, -ty, Matrix2D._TempPostTranslationMatrix);\r\n\r\n Matrix2D._TempPreTranslationMatrix.multiplyToRef(Matrix2D._TempScalingMatrix, Matrix2D._TempCompose0);\r\n Matrix2D._TempCompose0.multiplyToRef(Matrix2D._TempRotationMatrix, Matrix2D._TempCompose1);\r\n if (parentMatrix) {\r\n Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, Matrix2D._TempCompose2);\r\n Matrix2D._TempCompose2.multiplyToRef(parentMatrix, result);\r\n } else {\r\n Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, result);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"math2D.js","sourceRoot":"","sources":["../../../../../lts/gui/generated/2D/math2D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,OAAO,EAAE,gDAAkC;AAEpD;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,OAAO;IACxC;;;;OAIG;IACH,YACI,MAAe;IACf,6CAA6C;IACtC,cAAsB,CAAC;QAE9B,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAFnB,gBAAW,GAAX,WAAW,CAAY;IAGlC,CAAC;CACJ;AAED,+CAA+C;AAC/C,MAAM,OAAO,QAAQ;IAIjB;;;;;;;;OAQG;IACH,YAAY,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW;QAZxF,oEAAoE;QAC7D,MAAC,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;QAY3B,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;;;;OASG;IACI,UAAU,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW;QAC1F,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAA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AAC;SAC9D;aAAM;YACH,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;SACrF;IACL,CAAC;;AAnCc,kCAAyB,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAChD,mCAA0B,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACjD,4BAAmB,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAC1C,2BAAkB,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACzC,sBAAa,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACpC,sBAAa,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACpC,sBAAa,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { Epsilon } from \"core/Maths/math.constants\";\r\n\r\n/**\r\n * Class used to transport Vector2 information for pointer events\r\n */\r\nexport class Vector2WithInfo extends Vector2 {\r\n /**\r\n * Creates a new Vector2WithInfo\r\n * @param source defines the vector2 data to transport\r\n * @param buttonIndex defines the current mouse button index\r\n */\r\n public constructor(\r\n source: Vector2,\r\n /** defines the current mouse button index */\r\n public buttonIndex: number = 0\r\n ) {\r\n super(source.x, source.y);\r\n }\r\n}\r\n\r\n/** Class used to provide 2D matrix features */\r\nexport class Matrix2D {\r\n /** Gets the internal array of 6 floats used to store matrix data */\r\n public m = new Float32Array(6);\r\n\r\n /**\r\n * Creates a new matrix\r\n * @param m00 defines value for (0, 0)\r\n * @param m01 defines value for (0, 1)\r\n * @param m10 defines value for (1, 0)\r\n * @param m11 defines value for (1, 1)\r\n * @param m20 defines value for (2, 0)\r\n * @param m21 defines value for (2, 1)\r\n */\r\n constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number) {\r\n this.fromValues(m00, m01, m10, m11, m20, m21);\r\n }\r\n\r\n /**\r\n * Fills the matrix from direct values\r\n * @param m00 defines value for (0, 0)\r\n * @param m01 defines value for (0, 1)\r\n * @param m10 defines value for (1, 0)\r\n * @param m11 defines value for (1, 1)\r\n * @param m20 defines value for (2, 0)\r\n * @param m21 defines value for (2, 1)\r\n * @returns the current modified matrix\r\n */\r\n public fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D {\r\n this.m[0] = m00;\r\n this.m[1] = m01;\r\n this.m[2] = m10;\r\n this.m[3] = m11;\r\n this.m[4] = m20;\r\n this.m[5] = m21;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets matrix determinant\r\n * @returns the determinant\r\n */\r\n public determinant(): number {\r\n return this.m[0] * this.m[3] - this.m[1] * this.m[2];\r\n }\r\n\r\n /**\r\n * Inverses the matrix and stores it in a target matrix\r\n * @param result defines the target matrix\r\n * @returns the current matrix\r\n */\r\n public invertToRef(result: Matrix2D): Matrix2D {\r\n const l0 = this.m[0];\r\n const l1 = this.m[1];\r\n const l2 = this.m[2];\r\n const l3 = this.m[3];\r\n const l4 = this.m[4];\r\n const l5 = this.m[5];\r\n\r\n const det = this.determinant();\r\n if (det < Epsilon * Epsilon) {\r\n result.m[0] = 0;\r\n result.m[1] = 0;\r\n result.m[2] = 0;\r\n result.m[3] = 0;\r\n result.m[4] = 0;\r\n result.m[5] = 0;\r\n return this;\r\n }\r\n\r\n const detDiv = 1 / det;\r\n\r\n const det4 = l2 * l5 - l3 * l4;\r\n const det5 = l1 * l4 - l0 * l5;\r\n\r\n result.m[0] = l3 * detDiv;\r\n result.m[1] = -l1 * detDiv;\r\n result.m[2] = -l2 * detDiv;\r\n result.m[3] = l0 * detDiv;\r\n result.m[4] = det4 * detDiv;\r\n result.m[5] = det5 * detDiv;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies the current matrix with another one\r\n * @param other defines the second operand\r\n * @param result defines the target matrix\r\n * @returns the current matrix\r\n */\r\n public multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D {\r\n const l0 = this.m[0];\r\n const l1 = this.m[1];\r\n const l2 = this.m[2];\r\n const l3 = this.m[3];\r\n const l4 = this.m[4];\r\n const l5 = this.m[5];\r\n\r\n const r0 = other.m[0];\r\n const r1 = other.m[1];\r\n const r2 = other.m[2];\r\n const r3 = other.m[3];\r\n const r4 = other.m[4];\r\n const r5 = other.m[5];\r\n\r\n result.m[0] = l0 * r0 + l1 * r2;\r\n result.m[1] = l0 * r1 + l1 * r3;\r\n result.m[2] = l2 * r0 + l3 * r2;\r\n result.m[3] = l2 * r1 + l3 * r3;\r\n result.m[4] = l4 * r0 + l5 * r2 + r4;\r\n result.m[5] = l4 * r1 + l5 * r3 + r5;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Applies the current matrix to a set of 2 floats and stores the result in a vector2\r\n * @param x defines the x coordinate to transform\r\n * @param y defines the x coordinate to transform\r\n * @param result defines the target vector2\r\n * @returns the current matrix\r\n */\r\n public transformCoordinates(x: number, y: number, result: Vector2): Matrix2D {\r\n result.x = x * this.m[0] + y * this.m[2] + this.m[4];\r\n result.y = x * this.m[1] + y * this.m[3] + this.m[5];\r\n\r\n return this;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Creates an identity matrix\r\n * @returns a new matrix\r\n */\r\n public static Identity(): Matrix2D {\r\n return new Matrix2D(1, 0, 0, 1, 0, 0);\r\n }\r\n\r\n /**\r\n * Creates an identity matrix and stores it in a target matrix\r\n * @param result defines the target matrix\r\n */\r\n public static IdentityToRef(result: Matrix2D): void {\r\n result.m[0] = 1;\r\n result.m[1] = 0;\r\n result.m[2] = 0;\r\n result.m[3] = 1;\r\n result.m[4] = 0;\r\n result.m[5] = 0;\r\n }\r\n\r\n /**\r\n * Creates a translation matrix and stores it in a target matrix\r\n * @param x defines the x coordinate of the translation\r\n * @param y defines the y coordinate of the translation\r\n * @param result defines the target matrix\r\n */\r\n public static TranslationToRef(x: number, y: number, result: Matrix2D): void {\r\n result.fromValues(1, 0, 0, 1, x, y);\r\n }\r\n\r\n /**\r\n * Creates a scaling matrix and stores it in a target matrix\r\n * @param x defines the x coordinate of the scaling\r\n * @param y defines the y coordinate of the scaling\r\n * @param result defines the target matrix\r\n */\r\n public static ScalingToRef(x: number, y: number, result: Matrix2D): void {\r\n result.fromValues(x, 0, 0, y, 0, 0);\r\n }\r\n\r\n /**\r\n * Creates a rotation matrix and stores it in a target matrix\r\n * @param angle defines the rotation angle\r\n * @param result defines the target matrix\r\n */\r\n public static RotationToRef(angle: number, result: Matrix2D): void {\r\n const s = Math.sin(angle);\r\n const c = Math.cos(angle);\r\n\r\n result.fromValues(c, s, -s, c, 0, 0);\r\n }\r\n\r\n private static _TempPreTranslationMatrix = Matrix2D.Identity();\r\n private static _TempPostTranslationMatrix = Matrix2D.Identity();\r\n private static _TempRotationMatrix = Matrix2D.Identity();\r\n private static _TempScalingMatrix = Matrix2D.Identity();\r\n private static _TempCompose0 = Matrix2D.Identity();\r\n private static _TempCompose1 = Matrix2D.Identity();\r\n private static _TempCompose2 = Matrix2D.Identity();\r\n\r\n /**\r\n * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix\r\n * @param tx defines the x coordinate of the translation\r\n * @param ty defines the y coordinate of the translation\r\n * @param angle defines the rotation angle\r\n * @param scaleX defines the x coordinate of the scaling\r\n * @param scaleY defines the y coordinate of the scaling\r\n * @param parentMatrix defines the parent matrix to multiply by (can be null)\r\n * @param result defines the target matrix\r\n */\r\n public static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void {\r\n Matrix2D.TranslationToRef(tx, ty, Matrix2D._TempPreTranslationMatrix);\r\n\r\n Matrix2D.ScalingToRef(scaleX, scaleY, Matrix2D._TempScalingMatrix);\r\n\r\n Matrix2D.RotationToRef(angle, Matrix2D._TempRotationMatrix);\r\n\r\n Matrix2D.TranslationToRef(-tx, -ty, Matrix2D._TempPostTranslationMatrix);\r\n\r\n Matrix2D._TempPreTranslationMatrix.multiplyToRef(Matrix2D._TempScalingMatrix, Matrix2D._TempCompose0);\r\n Matrix2D._TempCompose0.multiplyToRef(Matrix2D._TempRotationMatrix, Matrix2D._TempCompose1);\r\n if (parentMatrix) {\r\n Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, Matrix2D._TempCompose2);\r\n Matrix2D._TempCompose2.multiplyToRef(parentMatrix, result);\r\n } else {\r\n Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, result);\r\n }\r\n }\r\n}\r\n"]}
package/2D/measure.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { Vector2 } from "@babylonjs/core/Maths/math.vector.js";
2
- var tmpRect = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)];
3
- var tmpRect2 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)];
4
- var tmpV1 = new Vector2(0, 0);
5
- var tmpV2 = new Vector2(0, 0);
2
+ const tmpRect = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)];
3
+ const tmpRect2 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)];
4
+ const tmpV1 = new Vector2(0, 0);
5
+ const tmpV2 = new Vector2(0, 0);
6
6
  /**
7
7
  * Class used to store 2D control sizes
8
8
  */
9
- var Measure = /** @class */ (function () {
9
+ export class Measure {
10
10
  /**
11
11
  * Creates a new measure
12
12
  * @param left defines left coordinate
@@ -14,7 +14,7 @@ var Measure = /** @class */ (function () {
14
14
  * @param width defines width dimension
15
15
  * @param height defines height dimension
16
16
  */
17
- function Measure(
17
+ constructor(
18
18
  /** defines left coordinate */
19
19
  left,
20
20
  /** defines top coordinate */
@@ -32,12 +32,12 @@ var Measure = /** @class */ (function () {
32
32
  * Copy from another measure
33
33
  * @param other defines the other measure to copy from
34
34
  */
35
- Measure.prototype.copyFrom = function (other) {
35
+ copyFrom(other) {
36
36
  this.left = other.left;
37
37
  this.top = other.top;
38
38
  this.width = other.width;
39
39
  this.height = other.height;
40
- };
40
+ }
41
41
  /**
42
42
  * Copy from a group of 4 floats
43
43
  * @param left defines left coordinate
@@ -45,28 +45,28 @@ var Measure = /** @class */ (function () {
45
45
  * @param width defines width dimension
46
46
  * @param height defines height dimension
47
47
  */
48
- Measure.prototype.copyFromFloats = function (left, top, width, height) {
48
+ copyFromFloats(left, top, width, height) {
49
49
  this.left = left;
50
50
  this.top = top;
51
51
  this.width = width;
52
52
  this.height = height;
53
- };
53
+ }
54
54
  /**
55
55
  * Computes the axis aligned bounding box measure for two given measures
56
56
  * @param a Input measure
57
57
  * @param b Input measure
58
58
  * @param result the resulting bounding measure
59
59
  */
60
- Measure.CombineToRef = function (a, b, result) {
61
- var left = Math.min(a.left, b.left);
62
- var top = Math.min(a.top, b.top);
63
- var right = Math.max(a.left + a.width, b.left + b.width);
64
- var bottom = Math.max(a.top + a.height, b.top + b.height);
60
+ static CombineToRef(a, b, result) {
61
+ const left = Math.min(a.left, b.left);
62
+ const top = Math.min(a.top, b.top);
63
+ const right = Math.max(a.left + a.width, b.left + b.width);
64
+ const bottom = Math.max(a.top + a.height, b.top + b.height);
65
65
  result.left = left;
66
66
  result.top = top;
67
67
  result.width = right - left;
68
68
  result.height = bottom - top;
69
- };
69
+ }
70
70
  /**
71
71
  * Computes the axis aligned bounding box of the measure after it is modified by a given transform
72
72
  * @param transform the matrix to transform the measure before computing the AABB
@@ -76,18 +76,18 @@ var Measure = /** @class */ (function () {
76
76
  * @param addHeight number to add to height
77
77
  * @param result the resulting AABB
78
78
  */
79
- Measure.prototype.addAndTransformToRef = function (transform, addX, addY, addWidth, addHeight, result) {
80
- var left = this.left + addX;
81
- var top = this.top + addY;
82
- var width = this.width + addWidth;
83
- var height = this.height + addHeight;
79
+ addAndTransformToRef(transform, addX, addY, addWidth, addHeight, result) {
80
+ const left = this.left + addX;
81
+ const top = this.top + addY;
82
+ const width = this.width + addWidth;
83
+ const height = this.height + addHeight;
84
84
  tmpRect[0].copyFromFloats(left, top);
85
85
  tmpRect[1].copyFromFloats(left + width, top);
86
86
  tmpRect[2].copyFromFloats(left + width, top + height);
87
87
  tmpRect[3].copyFromFloats(left, top + height);
88
88
  tmpV1.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE);
89
89
  tmpV2.copyFromFloats(0, 0);
90
- for (var i = 0; i < 4; i++) {
90
+ for (let i = 0; i < 4; i++) {
91
91
  transform.transformCoordinates(tmpRect[i].x, tmpRect[i].y, tmpRect2[i]);
92
92
  tmpV1.x = Math.floor(Math.min(tmpV1.x, tmpRect2[i].x));
93
93
  tmpV1.y = Math.floor(Math.min(tmpV1.y, tmpRect2[i].y));
@@ -98,21 +98,21 @@ var Measure = /** @class */ (function () {
98
98
  result.top = tmpV1.y;
99
99
  result.width = tmpV2.x - tmpV1.x;
100
100
  result.height = tmpV2.y - tmpV1.y;
101
- };
101
+ }
102
102
  /**
103
103
  * Computes the axis aligned bounding box of the measure after it is modified by a given transform
104
104
  * @param transform the matrix to transform the measure before computing the AABB
105
105
  * @param result the resulting AABB
106
106
  */
107
- Measure.prototype.transformToRef = function (transform, result) {
107
+ transformToRef(transform, result) {
108
108
  this.addAndTransformToRef(transform, 0, 0, 0, 0, result);
109
- };
109
+ }
110
110
  /**
111
111
  * Check equality between this measure and another one
112
112
  * @param other defines the other measures
113
113
  * @returns true if both measures are equals
114
114
  */
115
- Measure.prototype.isEqualsTo = function (other) {
115
+ isEqualsTo(other) {
116
116
  if (this.left !== other.left) {
117
117
  return false;
118
118
  }
@@ -126,15 +126,13 @@ var Measure = /** @class */ (function () {
126
126
  return false;
127
127
  }
128
128
  return true;
129
- };
129
+ }
130
130
  /**
131
131
  * Creates an empty measure
132
132
  * @returns a new measure
133
133
  */
134
- Measure.Empty = function () {
134
+ static Empty() {
135
135
  return new Measure(0, 0, 0, 0);
136
- };
137
- return Measure;
138
- }());
139
- export { Measure };
136
+ }
137
+ }
140
138
  //# sourceMappingURL=measure.js.map
package/2D/measure.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"measure.js","sourceRoot":"","sources":["../../../../../lts/gui/generated/2D/measure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAEjD,IAAM,OAAO,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE7F,IAAM,QAAQ,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE9F,IAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,IAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEhC;;GAEG;AACH;IACI;;;;;;OAMG;IACH;IACI,8BAA8B;IACvB,IAAY;IACnB,8BAA8B;IACvB,GAAW;IAClB,+BAA+B;IACxB,KAAa;IACpB,+BAA+B;IACxB,MAAc;QANd,SAAI,GAAJ,IAAI,CAAQ;QAEZ,QAAG,GAAH,GAAG,CAAQ;QAEX,UAAK,GAAL,KAAK,CAAQ;QAEb,WAAM,GAAN,MAAM,CAAQ;IACtB,CAAC;IAEJ;;;OAGG;IACI,0BAAQ,GAAf,UAAgB,KAAc;QAC1B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;QACrB,IA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AI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE;YAC9B,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACW,aAAK,GAAnB;QACI,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;IACL,cAAC;AAAD,CAAC,AAxID,IAwIC","sourcesContent":["import type { Matrix2D } from \"./math2D\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nconst tmpRect = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)];\r\n\r\nconst tmpRect2 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)];\r\n\r\nconst tmpV1 = new Vector2(0, 0);\r\nconst tmpV2 = new Vector2(0, 0);\r\n\r\n/**\r\n * Class used to store 2D control sizes\r\n */\r\nexport class Measure {\r\n /**\r\n * Creates a new measure\r\n * @param left defines left coordinate\r\n * @param top defines top coordinate\r\n * @param width defines width dimension\r\n * @param height defines height dimension\r\n */\r\n public constructor(\r\n /** defines left coordinate */\r\n public left: number,\r\n /** defines top coordinate */\r\n public top: number,\r\n /** defines width dimension */\r\n public width: number,\r\n /** defines height dimension */\r\n public height: number\r\n ) {}\r\n\r\n /**\r\n * Copy from another measure\r\n * @param other defines the other measure to copy from\r\n */\r\n public copyFrom(other: Measure): void {\r\n this.left = other.left;\r\n this.top = other.top;\r\n this.width = other.width;\r\n this.height = other.height;\r\n }\r\n\r\n /**\r\n * Copy from a group of 4 floats\r\n * @param left defines left coordinate\r\n * @param top defines top coordinate\r\n * @param width defines width dimension\r\n * @param height defines height dimension\r\n */\r\n public copyFromFloats(left: number, top: number, width: number, height: number): void {\r\n this.left = left;\r\n this.top = top;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n\r\n /**\r\n * Computes the axis aligned bounding box measure for two given measures\r\n * @param a Input measure\r\n * @param b Input measure\r\n * @param result the resulting bounding measure\r\n */\r\n public static CombineToRef(a: Measure, b: Measure, result: Measure) {\r\n const left = Math.min(a.left, b.left);\r\n const top = Math.min(a.top, b.top);\r\n const right = Math.max(a.left + a.width, b.left + b.width);\r\n const bottom = Math.max(a.top + a.height, b.top + b.height);\r\n result.left = left;\r\n result.top = top;\r\n result.width = right - left;\r\n result.height = bottom - top;\r\n }\r\n\r\n /**\r\n * Computes the axis aligned bounding box of the measure after it is modified by a given transform\r\n * @param transform the matrix to transform the measure before computing the AABB\r\n * @param addX number to add to left\r\n * @param addY number to add to top\r\n * @param addWidth number to add to width\r\n * @param addHeight number to add to height\r\n * @param result the resulting AABB\r\n */\r\n public addAndTransformToRef(transform: Matrix2D, addX: number, addY: number, addWidth: number, addHeight: number, result: Measure) {\r\n const left = this.left + addX;\r\n const top = this.top + addY;\r\n const width = this.width + addWidth;\r\n const height = this.height + addHeight;\r\n\r\n tmpRect[0].copyFromFloats(left, top);\r\n tmpRect[1].copyFromFloats(left + width, top);\r\n tmpRect[2].copyFromFloats(left + width, top + height);\r\n tmpRect[3].copyFromFloats(left, top + height);\r\n\r\n tmpV1.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE);\r\n tmpV2.copyFromFloats(0, 0);\r\n for (let i = 0; i < 4; i++) {\r\n transform.transformCoordinates(tmpRect[i].x, tmpRect[i].y, tmpRect2[i]);\r\n tmpV1.x = Math.floor(Math.min(tmpV1.x, tmpRect2[i].x));\r\n tmpV1.y = Math.floor(Math.min(tmpV1.y, tmpRect2[i].y));\r\n tmpV2.x = Math.ceil(Math.max(tmpV2.x, tmpRect2[i].x));\r\n tmpV2.y = Math.ceil(Math.max(tmpV2.y, tmpRect2[i].y));\r\n }\r\n result.left = tmpV1.x;\r\n result.top = tmpV1.y;\r\n result.width = tmpV2.x - tmpV1.x;\r\n result.height = tmpV2.y - tmpV1.y;\r\n }\r\n\r\n /**\r\n * Computes the axis aligned bounding box of the measure after it is modified by a given transform\r\n * @param transform the matrix to transform the measure before computing the AABB\r\n * @param result the resulting AABB\r\n */\r\n public transformToRef(transform: Matrix2D, result: Measure) {\r\n this.addAndTransformToRef(transform, 0, 0, 0, 0, result);\r\n }\r\n /**\r\n * Check equality between this measure and another one\r\n * @param other defines the other measures\r\n * @returns true if both measures are equals\r\n */\r\n public isEqualsTo(other: Measure): boolean {\r\n if (this.left !== other.left) {\r\n return false;\r\n }\r\n\r\n if (this.top !== other.top) {\r\n return false;\r\n }\r\n\r\n if (this.width !== other.width) {\r\n return false;\r\n }\r\n\r\n if (this.height !== other.height) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Creates an empty measure\r\n * @returns a new measure\r\n */\r\n public static Empty(): Measure {\r\n return new Measure(0, 0, 0, 0);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"measure.js","sourceRoot":"","sources":["../../../../../lts/gui/generated/2D/measure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAEjD,MAAM,OAAO,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE7F,MAAM,QAAQ,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE9F,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC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,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;IACD;;;;OAIG;IACI,UAAU,CAAC,KAAc;QAC5B,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE;YAC1B,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,EAAE;YACxB,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE;YAC5B,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE;YAC9B,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,KAAK;QACf,OAAO,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACJ","sourcesContent":["import type { Matrix2D } from \"./math2D\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nconst tmpRect = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)];\r\n\r\nconst tmpRect2 = [new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0), new Vector2(0, 0)];\r\n\r\nconst tmpV1 = new Vector2(0, 0);\r\nconst tmpV2 = new Vector2(0, 0);\r\n\r\n/**\r\n * Class used to store 2D control sizes\r\n */\r\nexport class Measure {\r\n /**\r\n * Creates a new measure\r\n * @param left defines left coordinate\r\n * @param top defines top coordinate\r\n * @param width defines width dimension\r\n * @param height defines height dimension\r\n */\r\n public constructor(\r\n /** defines left coordinate */\r\n public left: number,\r\n /** defines top coordinate */\r\n public top: number,\r\n /** defines width dimension */\r\n public width: number,\r\n /** defines height dimension */\r\n public height: number\r\n ) {}\r\n\r\n /**\r\n * Copy from another measure\r\n * @param other defines the other measure to copy from\r\n */\r\n public copyFrom(other: Measure): void {\r\n this.left = other.left;\r\n this.top = other.top;\r\n this.width = other.width;\r\n this.height = other.height;\r\n }\r\n\r\n /**\r\n * Copy from a group of 4 floats\r\n * @param left defines left coordinate\r\n * @param top defines top coordinate\r\n * @param width defines width dimension\r\n * @param height defines height dimension\r\n */\r\n public copyFromFloats(left: number, top: number, width: number, height: number): void {\r\n this.left = left;\r\n this.top = top;\r\n this.width = width;\r\n this.height = height;\r\n }\r\n\r\n /**\r\n * Computes the axis aligned bounding box measure for two given measures\r\n * @param a Input measure\r\n * @param b Input measure\r\n * @param result the resulting bounding measure\r\n */\r\n public static CombineToRef(a: Measure, b: Measure, result: Measure) {\r\n const left = Math.min(a.left, b.left);\r\n const top = Math.min(a.top, b.top);\r\n const right = Math.max(a.left + a.width, b.left + b.width);\r\n const bottom = Math.max(a.top + a.height, b.top + b.height);\r\n result.left = left;\r\n result.top = top;\r\n result.width = right - left;\r\n result.height = bottom - top;\r\n }\r\n\r\n /**\r\n * Computes the axis aligned bounding box of the measure after it is modified by a given transform\r\n * @param transform the matrix to transform the measure before computing the AABB\r\n * @param addX number to add to left\r\n * @param addY number to add to top\r\n * @param addWidth number to add to width\r\n * @param addHeight number to add to height\r\n * @param result the resulting AABB\r\n */\r\n public addAndTransformToRef(transform: Matrix2D, addX: number, addY: number, addWidth: number, addHeight: number, result: Measure) {\r\n const left = this.left + addX;\r\n const top = this.top + addY;\r\n const width = this.width + addWidth;\r\n const height = this.height + addHeight;\r\n\r\n tmpRect[0].copyFromFloats(left, top);\r\n tmpRect[1].copyFromFloats(left + width, top);\r\n tmpRect[2].copyFromFloats(left + width, top + height);\r\n tmpRect[3].copyFromFloats(left, top + height);\r\n\r\n tmpV1.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE);\r\n tmpV2.copyFromFloats(0, 0);\r\n for (let i = 0; i < 4; i++) {\r\n transform.transformCoordinates(tmpRect[i].x, tmpRect[i].y, tmpRect2[i]);\r\n tmpV1.x = Math.floor(Math.min(tmpV1.x, tmpRect2[i].x));\r\n tmpV1.y = Math.floor(Math.min(tmpV1.y, tmpRect2[i].y));\r\n tmpV2.x = Math.ceil(Math.max(tmpV2.x, tmpRect2[i].x));\r\n tmpV2.y = Math.ceil(Math.max(tmpV2.y, tmpRect2[i].y));\r\n }\r\n result.left = tmpV1.x;\r\n result.top = tmpV1.y;\r\n result.width = tmpV2.x - tmpV1.x;\r\n result.height = tmpV2.y - tmpV1.y;\r\n }\r\n\r\n /**\r\n * Computes the axis aligned bounding box of the measure after it is modified by a given transform\r\n * @param transform the matrix to transform the measure before computing the AABB\r\n * @param result the resulting AABB\r\n */\r\n public transformToRef(transform: Matrix2D, result: Measure) {\r\n this.addAndTransformToRef(transform, 0, 0, 0, 0, result);\r\n }\r\n /**\r\n * Check equality between this measure and another one\r\n * @param other defines the other measures\r\n * @returns true if both measures are equals\r\n */\r\n public isEqualsTo(other: Measure): boolean {\r\n if (this.left !== other.left) {\r\n return false;\r\n }\r\n\r\n if (this.top !== other.top) {\r\n return false;\r\n }\r\n\r\n if (this.width !== other.width) {\r\n return false;\r\n }\r\n\r\n if (this.height !== other.height) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Creates an empty measure\r\n * @returns a new measure\r\n */\r\n public static Empty(): Measure {\r\n return new Measure(0, 0, 0, 0);\r\n }\r\n}\r\n"]}