-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Control nodes multiply in size when child animationPlayer contains RESET track and a different scene is launched #90079
Comments
I forgot to include - Deleting the RESET track from the AnimationPlayer fixes the issue and nodes will no longer grow in size. |
I assume it is a bug in |
Is there anyone already working to fix this? |
@Borges-IST-2003 The challenge to fix it is welcome, but please work with attention to the following: I think the easiest way to fix this is probably to insert some notifications in the But before doing so, we need to investigate if there are any other Nodes that have this same bug. If no other Node seems to have the same bug, then it is likely that the problem is specific to Button, and you may need to fix the update process of If there are other Nodes that have the same bug, we need to figure out how to handle it correctly in editor_node.cpp or AnimationMixer. In other words, the scope of the fix needs to be clear. If all Control Nodes have the same bug and Node2D does not, then only the Control Nodes need to be treated in some way; Maybe Button and Control need some processing in the In any case, this is a bug that needs to be fixed, and if no one (even you) has made any progress by next week, I will get to work on. If you send a PR by about the first of next week, I will review it. |
Ok, sounds good, I'll get on it. |
Duplicate of #74047 btw. |
I just found out a similar bug! |
No, that's #89877 |
Ok, I believe that the bug is specific to the button because I have tried to replicate the bug with other control nodes but couldn't. |
I guess this is probably due to the fact that the automatic size adjustment is done at the next frame or at the Draw frame, since the scene in the other tab is not drawn. So we need to identify the row that do resizing and move it to a place where it will work on reload while in another tab. |
At the draw frame the button has already the wrong value, but if I render it again, on NOTIFICATION_EDITOR_POST_SAVE, the button has the original values, it is somewhere between save and draw that the value gets changed it seems, but then it gets changed again back to the original value when I try to run the scene again, and then it gets the wrong value on draw. |
Probably, this is a problem with the |
Workaround for Godot #90079 (godotengine/godot#90079). Godot has an exciting feature where Controls animated by an AnimationPlayer randomly change their position or size. This only affects the editor, and results an exciting and fun surprise for developers. I've added a workaround to prevent controls from randomly changing their position and size.
Tested versions
Bugsquad edited:
System information
Godot v4.2.stable.mono - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3090 Ti (NVIDIA; 31.0.15.5186) - 12th Gen Intel(R) Core(TM) i9-12900K (24 Threads)
Issue description
Certain conditions cause nodes to erroneously change size. When this happens, each time the steps are reproduced, the relevant nodes will increase in size by a multiple of the original size - i.e. the first time they will end up 2x the original, then 3x, then 4x and so on.
Steps to reproduce
The hierarchy looks like this where you have containers that structure the UI, an empty control node as a child to the container, and the another kind of node as a child of the empty control node. This last child also has an AnimationPlayer with a RESET track. This is to allow the other kind of node to be animated. Finally, set the control node and its child to use the anchor layout mode with the anchor preset set to Full Rect. I have tested this with Buttons, Labels, and LineEdits.
All of the above needs to be in 1 scene. Then while that scene is open in one tab, open a different scene in another tab and use Run Current Scene so the different scene is launched. You can immediately close that and go back to the original tab. In my example, this is what it would have started looking like and this is how it will end up. The new size of that node will be exactly 2x the starting size. If you repeat the process and launch the different scene again and come back, the node will now be 3x the starting size.
I recorded a video of this occurring, but I don't know how long it will remain available: https://streamable.com/5elh96.
Minimal reproduction project (MRP)
NodeSizeBug.zip
Simply open both the main and different scenes so there are 2 tabs open. Launch the different scene with F6, then kill it. Go back to the main tab and the button should be a multiple bigger.
The text was updated successfully, but these errors were encountered: