godotengine / godot

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

`Node2D.rotation == NAN` causes issues with 2D editor #96824

Open PixelTim opened 1 week ago

PixelTim commented 1 week ago

Tested versions

System information

Windows 7, Godot v4.3.stable

Issue description

When Node2D.rotation == NAN in editor, the node will not be displayed anywhere, and if you will select this node and press "Center view button", 2D editor will start working wrong. It won't display any of UI elements(like origin, viewport) and rulers will have no numbers on them(like on image below). NanRotationBug

Steps to reproduce

  1. In the scene tree dock, select the node2d(or any other 2d node) with rotation == NAN.
  2. Press "Center view" button.

Minimal reproduction project (MRP)

MRP includes Readme.txt to help you to reproduce the bug. github-nan-rotation-reproduction-project.zip

kleonc commented 1 week ago

Similar issue in 3D.

I'd say the item not being displayed is correct, but trying to center view on it should rather do nothing instead of propagating NANs into canvas/ruler/etc. calculations.