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

reset ideal width and height on serialization #16084

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

RaananW
Copy link
Member

@RaananW RaananW commented Jan 17, 2025

When closning an element in an ADT (i.e. a GUI element), the ideal width andd ideal height of its host influence the data serialized.
I consider this a bug on our end - serialized data should not be influenced by the object's parent.

This PR resets the ideal width and height of the ADT host when cloning an element.

There is an interesting "breaking change" here, but it is far fetched and probably not really used:
When cloning from one ADT to another, it is possible that the element will not have different size, if both ADTs have a different idealWidth or idealHeight.
However, as this can be considered a bug fix, the new behavior is the right one, so I don't see that as a problem nor as a breaking change.

PG to test: #KKA6L4#20

Forum post that triggered it:

https://forum.babylonjs.com/t/gui-control-clone-doesnt-respect-ideal-width/55494?u=raananw

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 17, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 17, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 17, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 17, 2025

@RaananW RaananW enabled auto-merge (squash) January 17, 2025 18:03
@RaananW RaananW merged commit 05b606e into BabylonJS:master Jan 17, 2025
13 of 14 checks passed
@RaananW RaananW deleted the resetIdealDimensionsOnSerialization branch January 20, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants