|
@@ -102,9 +102,11 @@ export class StackPanel extends Container {
|
|
this._measureForChildren.left = this._currentMeasure.left;
|
|
this._measureForChildren.left = this._currentMeasure.left;
|
|
this._measureForChildren.top = this._currentMeasure.top;
|
|
this._measureForChildren.top = this._currentMeasure.top;
|
|
|
|
|
|
- if (this.isVertical || this._manualWidth) {
|
|
|
|
|
|
+ if (!this.isVertical || this._manualWidth) {
|
|
this._measureForChildren.width = this._currentMeasure.width;
|
|
this._measureForChildren.width = this._currentMeasure.width;
|
|
- } else if (!this.isVertical || this._manualHeight) {
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (this.isVertical || this._manualHeight) {
|
|
this._measureForChildren.height = this._currentMeasure.height;
|
|
this._measureForChildren.height = this._currentMeasure.height;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -124,10 +126,7 @@ export class StackPanel extends Container {
|
|
child._top.ignoreAdaptiveScaling = true;
|
|
child._top.ignoreAdaptiveScaling = true;
|
|
}
|
|
}
|
|
|
|
|
|
- stackHeight += child._currentMeasure.height + child.paddingTopInPixels;
|
|
|
|
- if (child._currentMeasure.width > stackWidth) {
|
|
|
|
- stackWidth = child._currentMeasure.width;
|
|
|
|
- }
|
|
|
|
|
|
+ stackHeight += child._currentMeasure.height + child.paddingTopInPixels + child.paddingBottomInPixels;
|
|
} else {
|
|
} else {
|
|
if (child.left !== stackWidth + "px") {
|
|
if (child.left !== stackWidth + "px") {
|
|
child.left = stackWidth + "px";
|
|
child.left = stackWidth + "px";
|
|
@@ -135,27 +134,24 @@ export class StackPanel extends Container {
|
|
child._left.ignoreAdaptiveScaling = true;
|
|
child._left.ignoreAdaptiveScaling = true;
|
|
}
|
|
}
|
|
|
|
|
|
- stackWidth += child._currentMeasure.width + child.paddingLeftInPixels;
|
|
|
|
- if (child._currentMeasure.height > stackHeight) {
|
|
|
|
- stackHeight = child._currentMeasure.height;
|
|
|
|
- }
|
|
|
|
|
|
+ stackWidth += child._currentMeasure.width + child.paddingLeftInPixels + child.paddingRightInPixels;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
this._doNotTrackManualChanges = true;
|
|
this._doNotTrackManualChanges = true;
|
|
|
|
|
|
- // Let stack panel width and height default to stackHeight and stackWidth if dimensions are not specified.
|
|
|
|
|
|
+ // Let stack panel width or height default to stackHeight and stackWidth if dimensions are not specified.
|
|
// User can now define their own height and width for stack panel.
|
|
// User can now define their own height and width for stack panel.
|
|
|
|
|
|
let panelWidthChanged = false;
|
|
let panelWidthChanged = false;
|
|
let panelHeightChanged = false;
|
|
let panelHeightChanged = false;
|
|
|
|
|
|
- if (!this._manualHeight) { // do not specify height if strictly defined by user
|
|
|
|
|
|
+ if (!this._manualHeight && this._isVertical) { // do not specify height if strictly defined by user
|
|
let previousHeight = this.height;
|
|
let previousHeight = this.height;
|
|
this.height = stackHeight + "px";
|
|
this.height = stackHeight + "px";
|
|
panelHeightChanged = previousHeight !== this.height || !this._height.ignoreAdaptiveScaling;
|
|
panelHeightChanged = previousHeight !== this.height || !this._height.ignoreAdaptiveScaling;
|
|
}
|
|
}
|
|
- if (!this._manualWidth) { // do not specify width if strictly defined by user
|
|
|
|
|
|
+ if (!this._manualWidth && !this._isVertical) { // do not specify width if strictly defined by user
|
|
let previousWidth = this.width;
|
|
let previousWidth = this.width;
|
|
this.width = stackWidth + "px";
|
|
this.width = stackWidth + "px";
|
|
panelWidthChanged = previousWidth !== this.width || !this._width.ignoreAdaptiveScaling;
|
|
panelWidthChanged = previousWidth !== this.width || !this._width.ignoreAdaptiveScaling;
|