Merge pull request #87876 from permelin/fix-62341

Fix frame number underflow in visual profiler
This commit is contained in:
Rémi Verschelde 2024-02-15 15:44:50 +01:00
commit 17944bbb3a
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -70,7 +70,7 @@ void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) {
updating_frame = true; updating_frame = true;
clear_button->set_disabled(false); clear_button->set_disabled(false);
cursor_metric_edit->set_max(frame_metrics[last_metric].frame_number); cursor_metric_edit->set_max(frame_metrics[last_metric].frame_number);
cursor_metric_edit->set_min(MAX(frame_metrics[last_metric].frame_number - frame_metrics.size(), 0u)); cursor_metric_edit->set_min(MAX(int64_t(frame_metrics[last_metric].frame_number) - frame_metrics.size(), 0));
if (!seeking) { if (!seeking) {
cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number); cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number);