From a0d98831d7d3dfc498541f22800be98ed54a585b Mon Sep 17 00:00:00 2001 From: Carolina Herbster Date: Thu, 20 Oct 2022 16:35:55 -0300 Subject: [PATCH] Take into account adaptWidth/HeightToChildren in the StackPanel --- packages/dev/gui/src/2D/controls/stackPanel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dev/gui/src/2D/controls/stackPanel.ts b/packages/dev/gui/src/2D/controls/stackPanel.ts index d3cd8678943..bb417907c0f 100644 --- a/packages/dev/gui/src/2D/controls/stackPanel.ts +++ b/packages/dev/gui/src/2D/controls/stackPanel.ts @@ -198,13 +198,13 @@ export class StackPanel extends Container { let panelWidthChanged = false; let panelHeightChanged = false; - if (!this._manualHeight && this._isVertical) { + if ((!this._manualHeight || this.adaptHeightToChildren) && this._isVertical) { // do not specify height if strictly defined by user const previousHeight = this.height; this.height = stackHeight + "px"; panelHeightChanged = previousHeight !== this.height || !this._height.ignoreAdaptiveScaling; } - if (!this._manualWidth && !this._isVertical) { + if ((!this._manualWidth || this.adaptWidthToChildren) && !this._isVertical) { // do not specify width if strictly defined by user const previousWidth = this.width; this.width = stackWidth + "px";