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

Code before:
			} else {
				// Show zoom

				real_t min_distance = MAX(camera->get_near() * 4, ZOOM_FREELOOK_MIN);
				real_t max_distance = MIN(camera->get_far() / 4, ZOOM_FREELOOK_MAX);
				real_t scale_length = (max_distance - min_distance);

				if (!Math::is_zero_approx(scale_length)) {
					real_t logscale_t = 1.0 - Math::log(1 + cursor.distance - min_distance) / Math::log(1 + scale_length);

					// Display the zoom center distance to help the user get a better sense of scale.
					const int precision = cursor.distance < 1.0 ? 2 : 1;
					draw_indicator_bar(
							*surface,
							logscale_t,
							get_theme_icon("ViewportZoom", "EditorIcons"),
							get_theme_font("font", "Label"),
							get_theme_font_size("font_size", "Label"),
							vformat("%s u", String::num(cursor.distance).pad_decimals(precision)));
				}
			}
		}
	}
}

void Node3DEditorViewport::_menu_option(int p_option) {
	switch (p_option) {
		case VIEW_TOP: {
			cursor.y_rot = 0;
			cursor.x_rot = Math_PI / 2.0;
			set_message(TTR("Top View."), 2);
			name = TTR("Top");
			_set_auto_orthogonal();
			_update_name();

		} break;
		case VIEW_BOTTOM: {
			cursor.y_rot = 0;
			cursor.x_rot = -Math_PI / 2.0;
			set_message(TTR("Bottom View."), 2);
			name = TTR("Bottom");
			_set_auto_orthogonal();
			_update_name();

		} break;
		case VIEW_LEFT: {
			cursor.x_rot = 0;
			cursor.y_rot = Math_PI / 2.0;
			set_message(TTR("Left View."), 2);
			name = TTR("Left");
			_set_auto_orthogonal();

Review comment (suggestion):
This number is arbitrary, and the optimal number will likely vary between systems. 15 seems good to me, but maybe it should be higher or lower. A lower number will make the message show up sooner, which might be good or annoying.

Code after:
							1.0 - logscale_t,
							get_theme_icon("ViewportSpeed", "EditorIcons"),
							get_theme_font("font", "Label"),
							get_theme_font_size("font_size", "Label"),
							vformat("%s u/s", String::num(freelook_speed).pad_decimals(precision)));
				}

			} else {
				// Show zoom
				zoom_limit_label->set_visible(zoom_failed_attempts_count > 15);

				real_t min_distance = MAX(camera->get_near() * 4, ZOOM_FREELOOK_MIN);
				real_t max_distance = MIN(camera->get_far() / 4, ZOOM_FREELOOK_MAX);
				real_t scale_length = (max_distance - min_distance);

				if (!Math::is_zero_approx(scale_length)) {
					real_t logscale_t = 1.0 - Math::log(1 + cursor.distance - min_distance) / Math::log(1 + scale_length);

					// Display the zoom center distance to help the user get a better sense of scale.
					const int precision = cursor.distance < 1.0 ? 2 : 1;
					draw_indicator_bar(
							*surface,
							logscale_t,
							get_theme_icon("ViewportZoom", "EditorIcons"),
							get_theme_font("font", "Label"),
							get_theme_font_size("font_size", "Label"),
							vformat("%s u", String::num(cursor.distance).pad_decimals(precision)));
				}
			}
		}
	}
}

void Node3DEditorViewport::_menu_option(int p_option) {
	switch (p_option) {
		case VIEW_TOP: {
			cursor.y_rot = 0;
			cursor.x_rot = Math_PI / 2.0;
			set_message(TTR("Top View."), 2);
			name = TTR("Top");
			_set_auto_orthogonal();
			_update_name();

		} break;
		case VIEW_BOTTOM: {
			cursor.y_rot = 0;
			cursor.x_rot = -Math_PI / 2.0;
			set_message(TTR("Bottom View."), 2);
			name = TTR("Bottom");
			_set_auto_orthogonal();
			_update_name();