godotengine / godot

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

Error spam when measuring the size of control nodes while holding the Shift button #93738

Closed JekSun97 closed 2 months ago

JekSun97 commented 3 months ago

Tested versions

Godot 4.2.2, Godot 4.3 beta2

System information

Godot v4.3.beta2 - Windows 10.0.19045 - Vulkan (Mobile) - dedicated Radeon RX 560 Series (Advanced Micro Devices, Inc.; 31.0.14001.45012) - Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz (4 Threads)

Issue description

When we resize nodes of type Control, with size (0,0), while holding down the Shift button, error spam occurs: scene/gui/control.cpp:1456 - Condition "!isfinite(p_size.x) || !isfinite(p_size.y)" is true.

https://github.com/godotengine/godot/assets/130399274/32a594d5-8e4a-4962-a699-b12b2230efa5

Steps to reproduce

  1. Create a Panel node
  2. Center it so it becomes a point in the center
  3. Pull it by any side while holding Shift

Minimal reproduction project (MRP)

N/A

patwork commented 3 months ago

Yea, propably when control size is 0x0...

https://github.com/godotengine/godot/blob/4ab8fb809396fa38ba929fec97cfcb7193f1c44d/editor/plugins/canvas_item_editor_plugin.cpp#L1778-L1798

in line 1789 we have division by 0 and aspect = -nan