### 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
if (state.has("show_zoom_control")) {
		// This one is not user-controllable, but instrumentable
		zoom_widget->set_visible(state["show_zoom_control"]);
	}
	if (state.has("snap_rotation")) {
		snap_rotation = state["snap_rotation"];
		int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_ROTATION);
		snap_config_menu->get_popup()->set_item_checked(idx, snap_rotation);
	}
	if (state.has("snap_scale")) {
		snap_scale = state["snap_scale"];
		int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_SCALE);
		snap_config_menu->get_popup()->set_item_checked(idx, snap_scale);
	}
	if (state.has("snap_relative")) {
		snap_relative = state["snap_relative"];
		int idx = snap_config_menu->get_popup()->get_item_index(SNAP_RELATIVE);
		snap_config_menu->get_popup()->set_item_checked(idx, snap_relative);
	}
	if (state.has("snap_pixel")) {
		snap_pixel = state["snap_pixel"];
		int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_PIXEL);
		snap_config_menu->get_popup()->set_item_checked(idx, snap_pixel);
	}
	if (update_scrollbars) {
		_update_scrollbars();
	}
	viewport->queue_redraw();
}
void CanvasItemEditor::clear() {