Merge pull request #77796 from MewPurPur/yeah-no-one-needs-exaseconds

Fix profilers' GUI trees
This commit is contained in:
Rémi Verschelde 2023-06-05 13:42:54 +02:00
commit d214dc5a0c
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 6 additions and 6 deletions

View File

@ -660,15 +660,15 @@ EditorProfiler::EditorProfiler() {
variables->set_column_title(0, TTR("Name"));
variables->set_column_expand(0, true);
variables->set_column_clip_content(0, true);
variables->set_column_expand_ratio(0, 60);
variables->set_column_custom_minimum_width(0, 60);
variables->set_column_title(1, TTR("Time"));
variables->set_column_expand(1, false);
variables->set_column_clip_content(1, true);
variables->set_column_expand_ratio(1, 100);
variables->set_column_custom_minimum_width(1, 75 * EDSCALE);
variables->set_column_title(2, TTR("Calls"));
variables->set_column_expand(2, false);
variables->set_column_clip_content(2, true);
variables->set_column_expand_ratio(2, 60);
variables->set_column_custom_minimum_width(2, 50 * EDSCALE);
variables->connect("item_edited", callable_mp(this, &EditorProfiler::_item_edited));
graph = memnew(TextureRect);

View File

@ -114,7 +114,7 @@ String EditorVisualProfiler::_get_time_as_text(float p_time) {
int dmode = display_mode->get_selected();
if (dmode == DISPLAY_FRAME_TIME) {
return TS->format_number(rtos(p_time)) + " " + RTR("ms");
return TS->format_number(String::num(p_time, 2)) + " " + RTR("ms");
} else if (dmode == DISPLAY_FRAME_PERCENT) {
return TS->format_number(String::num(p_time * 100 / graph_limit, 2)) + " " + TS->percent_sign();
}
@ -790,11 +790,11 @@ EditorVisualProfiler::EditorVisualProfiler() {
variables->set_column_title(1, TTR("CPU"));
variables->set_column_expand(1, false);
variables->set_column_clip_content(1, true);
variables->set_column_custom_minimum_width(1, 60 * EDSCALE);
variables->set_column_custom_minimum_width(1, 75 * EDSCALE);
variables->set_column_title(2, TTR("GPU"));
variables->set_column_expand(2, false);
variables->set_column_clip_content(2, true);
variables->set_column_custom_minimum_width(2, 60 * EDSCALE);
variables->set_column_custom_minimum_width(2, 75 * EDSCALE);
variables->connect("cell_selected", callable_mp(this, &EditorVisualProfiler::_item_selected));
graph = memnew(TextureRect);