Skip to content

Commit

Permalink
Fix stack panel giving a warning for children with resizeToFit. (#14452)
Browse files Browse the repository at this point in the history
* Fix stack panel giving a warning for children with resizeToFit.

* Update packages/dev/gui/src/2D/controls/stackPanel.ts

Co-authored-by: Raanan Weber <raananw+github@gmail.com>

* Update packages/dev/gui/src/2D/controls/stackPanel.ts

Co-authored-by: Raanan Weber <raananw+github@gmail.com>

---------

Co-authored-by: Raanan Weber <raananw+github@gmail.com>
  • Loading branch information
carolhmj and RaananW committed Oct 24, 2023
1 parent 54b8495 commit f82caf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/dev/gui/src/2D/controls/stackPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export class StackPanel extends Container {
child._top.ignoreAdaptiveScaling = true;
}

if (child._height.isPercentage && !child._automaticSize) {
if (child._height.isPercentage && !child._automaticSize && !(child as TextBlock).resizeToFit) {
if (!this.ignoreLayoutWarnings) {
Tools.Warn(`Control (Name:${child.name}, UniqueId:${child.uniqueId}) is using height in percentage mode inside a vertical StackPanel`);
}
Expand Down

0 comments on commit f82caf9

Please sign in to comment.