-
Notifications
You must be signed in to change notification settings - Fork 792
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
Shrink operator if possible (when changing data type) #6668
Shrink operator if possible (when changing data type) #6668
Conversation
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. VFX Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
Checked different types of operators like Switch, Probability sampling. in graphs, subgraphs blocks and subgraph operators
Example: 1. Create Arc Cosine and float operators 2. Change Arc Cosine to vector4 type and connect float to it 3. Observe that Arc Cosine type switches from vector to float but operator remains large with xyzw inputs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick verification and confidence check. Couldn't find any outstanding issues. Thank you for taking care of this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It's pretty minor, thanks for the fix.
* Shrink operator if possible (when changing data type) * Updated changelog * Reset minwidth when the operator is expanded (so that it can shrink if possible)
Purpose of this PR
https://fogbugz.unity3d.com/f/cases/1364445/
Repro steps:
👍 Expected result: the operator shrinks back to the min size required to display a Float value
👎 Actual result: the operator keeps a much larger size than needed
With this fix, the operator will shrink back to the minimum width only when the "edit ⚙" mode is ended.
[Before]
[After]
Testing status
float
=>vector3
=>float
Comments to reviewers
Seems to happen for all operators (add, branch, noise, etc.)
Note that collapsing the operator and then expanding it was already resizing the operator to its minimum size and also it ends the "edit ⚙" mode.
This is somehow a regression introduced by the fix I did to keep the operator width constant, even when it's collapsed.
But I think the behavior is even better now because the operator does not change size every time you change the type of an input (while in edit mode) only when you leave the edit mode.