reset ideal width and height on serialization #16084
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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