Repository: godotengine/godot
File: editor/plugins/node_3d_editor_plugin.cpp (C++)

Code before:
			surface->connect(SceneStringName(draw), callable_mp(this, &Node3DEditorViewport::_draw));
			surface->connect(SceneStringName(gui_input), callable_mp(this, &Node3DEditorViewport::_sinput));
			surface->connect(SceneStringName(mouse_entered), callable_mp(this, &Node3DEditorViewport::_surface_mouse_enter));
			surface->connect(SceneStringName(mouse_exited), callable_mp(this, &Node3DEditorViewport::_surface_mouse_exit));
			surface->connect(SceneStringName(focus_entered), callable_mp(this, &Node3DEditorViewport::_surface_focus_enter));
			surface->connect(SceneStringName(focus_exited), callable_mp(this, &Node3DEditorViewport::_surface_focus_exit));

			_init_gizmo_instance(index);
		} break;

		case NOTIFICATION_EXIT_TREE: {
			_finish_gizmo_instances();
		} break;

		case NOTIFICATION_THEME_CHANGED: {
			view_menu->set_button_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
			preview_camera->set_button_icon(get_editor_theme_icon(SNAME("Camera3D")));
			Control *gui_base = EditorNode::get_singleton()->get_gui_base();

			const Ref<StyleBox> &information_3d_stylebox = gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles));

			view_menu->begin_bulk_theme_override();
			view_menu->add_theme_style_override(CoreStringName(normal), information_3d_stylebox);
			view_menu->add_theme_style_override("normal_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override("hover", information_3d_stylebox);
			view_menu->add_theme_style_override("hover_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override("hover_pressed", information_3d_stylebox);
			view_menu->add_theme_style_override("hover_pressed_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override(SceneStringName(pressed), information_3d_stylebox);
			view_menu->add_theme_style_override("pressed_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override("focus", information_3d_stylebox);
			view_menu->add_theme_style_override("focus_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override("disabled", information_3d_stylebox);
			view_menu->add_theme_style_override("disabled_mirrored", information_3d_stylebox);
			view_menu->end_bulk_theme_override();

			preview_camera->begin_bulk_theme_override();
			preview_camera->add_theme_style_override(CoreStringName(normal), information_3d_stylebox);
			preview_camera->add_theme_style_override("normal_mirrored", information_3d_stylebox);
			preview_camera->add_theme_style_override("hover", information_3d_stylebox);
			preview_camera->add_theme_style_override("hover_mirrored", information_3d_stylebox);
			preview_camera->add_theme_style_override("hover_pressed", information_3d_stylebox);
			preview_camera->add_theme_style_override("hover_pressed_mirrored", information_3d_stylebox);
			preview_camera->add_theme_style_override(SceneStringName(pressed), information_3d_stylebox);
			preview_camera->add_theme_style_override("pressed_mirrored", information_3d_stylebox);
			preview_camera->add_theme_style_override("focus", information_3d_stylebox);
			preview_camera->add_theme_style_override("focus_mirrored", information_3d_stylebox);
			preview_camera->add_theme_style_override("disabled", information_3d_stylebox);
			preview_camera->add_theme_style_override("disabled_mirrored", information_3d_stylebox);
			preview_camera->end_bulk_theme_override();


Review comment (suggestion):
```suggestion
					if (ruler->is_inside_tree() && !ruler_start_point->is_visible()) {
						ruler_end_point->set_global_position(ruler_start_point->get_global_position());
						ruler_start_point->set_visible(true);
						ruler_end_point->set_visible(true);
						ruler_label->set_visible(true);
```

Code after:
						selected_node = ruler_start_point;
					}
				} else {
					List<Node *> &selection = editor_selection->get_selected_node_list();
					if (selection.size() == 1) {
						selected_node = Object::cast_to<Node3D>(selection.front()->get());
					}
				}

				if (selected_node) {
					if (!ruler->is_inside_tree()) {
						double snap = EDITOR_GET("interface/inspector/default_float_step");
						int snap_step_decimals = Math::range_step_decimals(snap);
						set_message(TTR("Translating:") + " (" + String::num(selected_node->get_global_position().x, snap_step_decimals) + ", " +
								String::num(selected_node->get_global_position().y, snap_step_decimals) + ", " + String::num(selected_node->get_global_position().z, snap_step_decimals) + ")");
					}

					selected_node->set_global_position(spatial_editor->snap_point(_get_instance_position(_edit.mouse_pos, selected_node)));

					if (ruler->is_inside_tree() && !ruler_start_point->is_visible()) {
						ruler_end_point->set_global_position(ruler_start_point->get_global_position());
						ruler_start_point->set_visible(true);
						ruler_end_point->set_visible(true);
						ruler_label->set_visible(true);
					}
				}
			}

			if (!update_preview_node) {
				return;
			}
			if (preview_node->is_inside_tree()) {
				preview_node_pos = spatial_editor->snap_point(_get_instance_position(preview_node_viewport_pos, preview_node));
				double snap = EDITOR_GET("interface/inspector/default_float_step");
				int snap_step_decimals = Math::range_step_decimals(snap);
				set_message(TTR("Instantiating:") + " (" + String::num(preview_node_pos.x, snap_step_decimals) + ", " +
						String::num(preview_node_pos.y, snap_step_decimals) + ", " + String::num(preview_node_pos.z, snap_step_decimals) + ")");
				Transform3D preview_gl_transform = Transform3D(Basis(), preview_node_pos);
				preview_node->set_global_transform(preview_gl_transform);
				if (!preview_node->is_visible()) {
					preview_node->show();
				}
			}
			update_preview_node = false;
		} break;

		case NOTIFICATION_APPLICATION_FOCUS_OUT:
		case NOTIFICATION_WM_WINDOW_FOCUS_OUT: {
			set_freelook_active(false);
			cursor.region_select = false;
			surface->queue_redraw();