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

Code before:
	position_control->set_anchor_and_offset(SIDE_TOP, ANCHOR_END, -navigation_control_size * EDSCALE);
	position_control->set_anchor_and_offset(SIDE_RIGHT, ANCHOR_BEGIN, navigation_control_size * EDSCALE);
	position_control->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0);
	position_control->set_viewport(this);
	surface->add_child(position_control);

	look_control = memnew(ViewportNavigationControl);
	look_control->set_navigation_mode(Node3DEditorViewport::NAVIGATION_LOOK);
	look_control->set_custom_minimum_size(Size2(navigation_control_size, navigation_control_size) * EDSCALE);
	look_control->set_h_size_flags(SIZE_SHRINK_END);
	look_control->set_anchor_and_offset(SIDE_LEFT, ANCHOR_END, -navigation_control_size * EDSCALE);
	look_control->set_anchor_and_offset(SIDE_TOP, ANCHOR_END, -navigation_control_size * EDSCALE);
	look_control->set_anchor_and_offset(SIDE_RIGHT, ANCHOR_END, 0);
	look_control->set_anchor_and_offset(SIDE_BOTTOM, ANCHOR_END, 0);
	look_control->set_viewport(this);
	surface->add_child(look_control);

	rotation_control = memnew(ViewportRotationControl);
	rotation_control->set_custom_minimum_size(Size2(80, 80) * EDSCALE);
	rotation_control->set_h_size_flags(SIZE_SHRINK_END);
	rotation_control->set_viewport(this);
	top_right_vbox->add_child(rotation_control);

	frame_time_panel = memnew(PanelContainer);
	top_right_vbox->add_child(frame_time_panel);
	frame_time_panel->hide();

	frame_time_vbox = memnew(VBoxContainer);
	frame_time_panel->add_child(frame_time_vbox);

	// Individual Labels are used to allow coloring each label with its own color.
	cpu_time_label = memnew(Label);
	frame_time_vbox->add_child(cpu_time_label);

	gpu_time_label = memnew(Label);
	frame_time_vbox->add_child(gpu_time_label);

	fps_label = memnew(Label);
	frame_time_vbox->add_child(fps_label);

	surface->add_child(top_right_vbox);

	accept = nullptr;

	freelook_active = false;
	freelook_speed = EDITOR_GET("editors/3d/freelook/freelook_base_speed");

	selection_menu = memnew(PopupMenu);
	add_child(selection_menu);
	selection_menu->set_min_size(Size2(100, 0) * EDSCALE);
	selection_menu->connect(SceneStringName(id_pressed), callable_mp(this, &Node3DEditorViewport::_selection_result_pressed));

Review comment (suggestion):
```suggestion
			disabled = OS::get_singleton()->get_current_rendering_method() != "forward_plus";
```

Code after:

void Node3DEditorViewport::_set_lock_view_rotation(bool p_lock_rotation) {
	lock_rotation = p_lock_rotation;
	int idx = view_display_menu->get_popup()->get_item_index(VIEW_LOCK_ROTATION);
	view_display_menu->get_popup()->set_item_checked(idx, p_lock_rotation);
	if (p_lock_rotation) {
		locked_label->show();
	} else {
		locked_label->hide();
	}
}

void Node3DEditorViewport::_add_advanced_debug_draw_mode_item(PopupMenu *p_popup, const String &p_name, int p_value, SupportedRenderingMethods p_rendering_methods, const String &p_tooltip) {
	display_submenu->add_radio_check_item(p_name, p_value);

	bool disabled = false;
	String disabled_tooltip;
	switch (p_rendering_methods) {
		case SupportedRenderingMethods::ALL:
			break;
		case SupportedRenderingMethods::FORWARD_PLUS_MOBILE:
			disabled = OS::get_singleton()->get_current_rendering_method() == "gl_compatibility";
			disabled_tooltip = TTR("This debug draw mode is not supported when using the Compatibility rendering method.");
			break;
		case SupportedRenderingMethods::FORWARD_PLUS:
			disabled = OS::get_singleton()->get_current_rendering_method() == "gl_compatibility" || OS::get_singleton()->get_current_rendering_method() == "mobile";
			disabled_tooltip = TTR("This debug draw mode is not supported when using the Mobile or Compatibility rendering methods.");
			break;
	}

	display_submenu->set_item_disabled(-1, disabled);
	String tooltip = p_tooltip;
	if (disabled) {
		if (tooltip.is_empty()) {
			tooltip = disabled_tooltip;
		} else {
			tooltip += "\n\n" + disabled_tooltip;
		}
	}
	display_submenu->set_item_tooltip(-1, tooltip);
}

Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p_index) {
	cpu_time_history_index = 0;
	gpu_time_history_index = 0;

	_edit.mode = TRANSFORM_NONE;
	_edit.plane = TRANSFORM_VIEW;
	_edit.snap = true;
	_edit.show_rotation_line = true;
	_edit.instant = false;