### Godot version

4.0.2

### System information

Windows 10,Radeon RX 550/550 Series,23.3.2,Vulkan

### Issue description

After Switching to the animations tabs and pressing the key symbol because I wanted to know what it does, Godot crashes

### Steps to reproduce

Go into a project 
Switch to the Animations Tab, make sure no animation is active 
And then press on the key symbol

here is a video demonstrating the bug

https://user-images.githubusercontent.com/59411880/233839816-5489899e-828f-4ac9-9de3-7914f727f754.mp4



### Minimal reproduction project

The File
[package.zip](https://github.com/godotengine/godot/files/11303712/package.zip)

Color bg_color = get_theme_color(SNAME("dark_color_2"), SNAME("Editor"));
	Color graduation_color = get_theme_color(SNAME("font_color"), SNAME("Editor")).lerp(bg_color, 0.5);
	Color font_color = get_theme_color(SNAME("font_color"), SNAME("Editor"));
	font_color.a = 0.8;
	Ref<Font> font = get_theme_font(SNAME("rulers"), SNAME("EditorFonts"));
	int font_size = get_theme_font_size(SNAME("rulers_size"), SNAME("EditorFonts"));
	
	Transform2D ruler_transform;
	if (grid_snap_active || _is_grid_visible()) {
		List<CanvasItem *> selection = _get_edited_canvas_items();
		if (snap_relative && selection.size() > 0) {
			ruler_transform.translate_local(_get_encompassing_rect_from_list(selection).position);
			ruler_transform.scale_basis(grid_step * Math::pow(2.0, grid_step_multiplier));
		} else {
			ruler_transform.translate_local(grid_offset);
			ruler_transform.scale_basis(grid_step * Math::pow(2.0, grid_step_multiplier));
		}
		while ((transform * ruler_transform).get_scale().x < 50 || (transform * ruler_transform).get_scale().y < 50) {
			ruler_transform.scale_basis(Point2(2, 2));