godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.69k stars 21.11k forks source link

ProgressBar from saved scene has its size changed by a Control node after reopening the scene again. #97947

Open viksl opened 3 weeks ago

viksl commented 3 weeks ago

Tested versions

4.4.dev3, 4.3 standard, 4.3-mono, 4.3.1-mono-rc

System information

Windows 11 - Vulkan - Nvidia RTX 4070 - intel i5 13600KF

Issue description

I have a scene which has a Control node (nothing else) and a ProgressBar, this ProgressBar was saved as a separate scene, now when I close the Control scene the ProgressBar gets resized if it's around the border (not outside but just precisely on the border, in the video it's the top left corner). If I put the progress away from the edges/corners it seems to be fine. Same happens when the Control scene is used in another scene as a Ui for example.

Watch the video below please.

https://github.com/user-attachments/assets/ef296f54-fce9-46ab-a3d6-31dc47490809

From what it seems to me the ProgressBar resizes to fit the font size despite the Show Percentage being unchecked, I also tried to override the font size to 1 px but that did not change this behaviour at all.

Steps to reproduce

  1. Create a new Control scene with a Control Node as the top node.
  2. Add a ProgressBar (name it however you want).
  3. Save the scene (I'll refer to this file as Control scene).
  4. Change ProgressBar size down (it needs to be smaller than some who knows what value): Layout -> Transform -> Size (67, 5)
  5. Uncheck ProgressBar's ShowPercentage (make sure it doesn't show any numbers otherwise you can't resize it below the font size limit!)
  6. Right click the ProgressBar and save it as a scene (I'll refer to this file as a Progress scene).
  7. Now close the Control scene.
  8. Open the Control scene again.
  9. (If it did not work then you might need to delete the ProgressBar from the scene and drag and drop the save Progress scene into the Control node and make sure you keep it at the origin - top left corner.
  10. Observer the ProgressBar expanding to some random size (it might be related to some default font size perhaps, at least that's what it looks like to me it resizes to?)

Minimal reproduction project (MRP)

ProgressBarMrp.zip

AThousandShips commented 3 weeks ago

Sounds like it could be related to:

Can you please try 4.4.dev3?

viksl commented 3 weeks ago

@AThousandShips Hi, I tried the 4.4 dev3 but the issue is there too.