瀏覽代碼

Fix frame number underflow in visual profiler

Unsigned subtraction underflow caused the frame counter to be locked at
2^64 in the visual profiler until debugger/profiler_frame_history_size
number of frames had passed.
Per Melin 1 年之前
父節點
當前提交
27dc9fa4c0
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/debugger/editor_visual_profiler.cpp

+ 1 - 1
editor/debugger/editor_visual_profiler.cpp

@@ -70,7 +70,7 @@ void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) {
 	updating_frame = true;
 	clear_button->set_disabled(false);
 	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) {
 		cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number);