### Godot version

4.2 dev3

### System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

### Issue description

Basically variation of #33995

### Steps to reproduce

1. Open 2D scene
2. Drag a guide
3. Undo
4. Save

### Minimal reproduction project

N/A
main_menu_hbox->add_child(list_select_button);
	list_select_button->set_toggle_mode(true);
	list_select_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_LIST_SELECT));
	list_select_button->set_tooltip_text(TTR("Show list of selectable nodes at position clicked."));
	pivot_button = memnew(Button);
	pivot_button->set_flat(true);
	main_menu_hbox->add_child(pivot_button);
	pivot_button->set_toggle_mode(true);
	pivot_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_EDIT_PIVOT));
	pivot_button->set_tooltip_text(TTR("Click to change object's rotation pivot."));
	pan_button = memnew(Button);
	pan_button->set_flat(true);
	main_menu_hbox->add_child(pan_button);
	pan_button->set_toggle_mode(true);
	pan_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_PAN));
	pan_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/pan_mode", TTR("Pan Mode"), Key::G));
	pan_button->set_shortcut_context(this);
	pan_button->set_tooltip_text(TTR("You can also use Pan View shortcut (Space by default) to pan in any mode."));
	ruler_button = memnew(Button);
	ruler_button->set_flat(true);
	main_menu_hbox->add_child(ruler_button);
	ruler_button->set_toggle_mode(true);
	ruler_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_RULER));
	ruler_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/ruler_mode", TTR("Ruler Mode"), Key::R));
	ruler_button->set_shortcut_context(this);
	ruler_button->set_tooltip_text(TTR("Ruler Mode"));
	main_menu_hbox->add_child(memnew(VSeparator));
	smart_snap_button = memnew(Button);
	smart_snap_button->set_flat(true);
	main_menu_hbox->add_child(smart_snap_button);