@energy8platform/game-engine 0.14.2 → 0.14.3
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/index.cjs.js +17 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +17 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/react.cjs.js +30 -10
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.esm.js +30 -10
- package/dist/react.esm.js.map +1 -1
- package/dist/ui.cjs.js +17 -3
- package/dist/ui.cjs.js.map +1 -1
- package/dist/ui.d.ts +4 -0
- package/dist/ui.esm.js +17 -3
- package/dist/ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/react/applyProps.ts +1 -1
- package/src/react/reconciler.ts +19 -7
- package/src/ui/FlexContainer.ts +7 -3
- package/src/ui/Panel.ts +10 -0
package/dist/index.cjs.js
CHANGED
|
@@ -3258,7 +3258,8 @@ class FlexContainer extends pixi_js.Container {
|
|
|
3258
3258
|
this._explicitWidth = width;
|
|
3259
3259
|
this._explicitHeight = height;
|
|
3260
3260
|
this._layoutDirty = true;
|
|
3261
|
-
this.
|
|
3261
|
+
if (!this._layoutSuspended)
|
|
3262
|
+
this.updateLayout();
|
|
3262
3263
|
}
|
|
3263
3264
|
/** Update layout direction */
|
|
3264
3265
|
setDirection(direction) {
|
|
@@ -3291,6 +3292,10 @@ class FlexContainer extends pixi_js.Container {
|
|
|
3291
3292
|
* adding/removing children without resize.
|
|
3292
3293
|
*/
|
|
3293
3294
|
updateLayout() {
|
|
3295
|
+
if (this._layoutSuspended) {
|
|
3296
|
+
this._layoutDirty = true;
|
|
3297
|
+
return;
|
|
3298
|
+
}
|
|
3294
3299
|
this._layoutDirty = false;
|
|
3295
3300
|
const { direction, justifyContent, alignItems, gap, flexWrap, alignContent } = this._config;
|
|
3296
3301
|
const [pt, pr, pb, pl] = this._padding;
|
|
@@ -3499,11 +3504,12 @@ class FlexContainer extends pixi_js.Container {
|
|
|
3499
3504
|
this._explicitWidth = typeof w === 'number' ? w : 0;
|
|
3500
3505
|
this._explicitHeight = typeof h === 'number' ? h : 0;
|
|
3501
3506
|
this._layoutDirty = true;
|
|
3502
|
-
this.
|
|
3507
|
+
if (!this._layoutSuspended)
|
|
3508
|
+
this.updateLayout();
|
|
3503
3509
|
}
|
|
3504
3510
|
return;
|
|
3505
3511
|
}
|
|
3506
|
-
if (this._layoutDirty)
|
|
3512
|
+
if (this._layoutDirty && !this._layoutSuspended)
|
|
3507
3513
|
this.updateLayout();
|
|
3508
3514
|
}
|
|
3509
3515
|
destroy(options) {
|
|
@@ -4086,6 +4092,14 @@ class Panel extends pixi_js.Container {
|
|
|
4086
4092
|
get content() {
|
|
4087
4093
|
return this._content;
|
|
4088
4094
|
}
|
|
4095
|
+
/** Suspend content layout recalculation. Call resumeLayout() to flush. */
|
|
4096
|
+
suspendLayout() {
|
|
4097
|
+
this._content.suspendLayout();
|
|
4098
|
+
}
|
|
4099
|
+
/** Resume content layout and flush if dirty. */
|
|
4100
|
+
resumeLayout() {
|
|
4101
|
+
this._content.resumeLayout();
|
|
4102
|
+
}
|
|
4089
4103
|
/** Convenience: add a child to the content layout */
|
|
4090
4104
|
addContent(child) {
|
|
4091
4105
|
this._content.addFlexChild(child);
|