Repository: godotengine/godot (language: cpp)

Issue:
Camera wireframe widget gizmo doesn't match FOV.
### Tested versions

4.2-4.4 dev 7

### System information

Godot v4.4.dev7 - Windows 10 (build 19045) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 32.0.15.6603) - AMD Ryzen 7 3700X 8-Core Processor (16 threads)

### Issue description

If you try to place items in the world so that they line up a certain way with the camera using the wireframe shape of the gizmo for a guide, they don't show up where expected.  For example, if I want something in the lower left corner of the view and line it up like this:

![Image](https://github.com/user-attachments/assets/9b98d761-386a-4e96-99f5-4c1b375267a3)

I would expect this to be in the lower left corner, but when viewed from the camera, it looks like this:

![Image](https://github.com/user-attachments/assets/5e1752a1-97fb-4417-a5e9-96641cb71e6e)

Quite far away from the corner.  I have to position the mesh outside of what it looks like the camera to see in order to get it in the corner.


### Steps to reproduce

Make a simple 3D scene with a camera.  Place an object where it looks like it will be in the corner of the camera.  Run the scene or preview the camera and note that the object is inset quite a bit from the corner.

### Minimal reproduction project (MRP)

[test_camera_fov.zip](https://github.com/user-attachments/files/18403949/test_camera_fov.zip)


Discussion / hints:

Fix patch:
diff --git a/editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp
index 257db67410ba..c85f8221aaa6 100644
--- a/editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp
@@ -180,7 +180,13 @@ void Camera3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
 
 			const float hsize = Math::sin(Math::deg_to_rad(fov));
 			const float depth = -Math::cos(Math::deg_to_rad(fov));
-			Vector3 side = Vector3(hsize * size_factor.x, 0, depth);
+
+			Vector3 side;
+			if (camera->get_keep_aspect_mode() == Camera3D::KEEP_WIDTH) {
+				side = Vector3(hsize * size_factor.x, 0, depth * size_factor.x);
+			} else {
+				side = Vector3(hsize * size_factor.x, 0, depth * size_factor.y);
+			}
 			Vector3 nside = Vector3(-side.x, side.y, side.z);
 			Vector3 up = Vector3(0, hsize * size_factor.y, 0);
 


Test patch: