Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for wrongly rendered GUI rectangle on resize with adaptWidthToChildren #10221

Merged
merged 5 commits into from Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions dist/preview release/what's new.md
Expand Up @@ -197,6 +197,7 @@
- Fix context lost handling ([#10163](https://github.com/BabylonJS/Babylon.js/issues/10163)) ([Popov72](https://github.com/Popov72))
- Fix for GUI slider step values greater than one ([msDestiny14](https://github.com/msDestiny14))
- Fix Instances wrongly rendered with motion blur ([CraigFeldspar](https://github.com/CraigFeldspar))
- Fix for wrongly rendered GUI rectangle on resize with adaptWidthToChildren ([msDestiny14](https://github.com/msDestiny14))

## Breaking changes

Expand Down
2 changes: 2 additions & 0 deletions gui/src/2D/controls/container.ts
Expand Up @@ -381,13 +381,15 @@ export class Container extends Control {
if (this.adaptWidthToChildren && computedWidth >= 0) {
computedWidth += this.paddingLeftInPixels + this.paddingRightInPixels;
if (this.width !== computedWidth + "px") {
this.parent?._markAsDirty();
this.width = computedWidth + "px";
this._rebuildLayout = true;
}
}
if (this.adaptHeightToChildren && computedHeight >= 0) {
computedHeight += this.paddingTopInPixels + this.paddingBottomInPixels;
if (this.height !== computedHeight + "px") {
this.parent?._markAsDirty();
this.height = computedHeight + "px";
this._rebuildLayout = true;
}
Expand Down