Skip to content

Commit

Permalink
Merge pull request #13144 from carolhmj/GUIFixStackPanelAdaptWidthHeight
Browse files Browse the repository at this point in the history
Take into account adaptWidth/HeightToChildren in the StackPanel
  • Loading branch information
sebavan authored Oct 20, 2022
2 parents 210ac59 + a0d9883 commit 6e657ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/dev/gui/src/2D/controls/stackPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 6e657ff

Please sign in to comment.