summaryrefslogtreecommitdiffstats
path: root/editor/debugger/editor_visual_profiler.cpp
diff options
context:
space:
mode:
authorPer Melin <git@melin.net>2024-02-02 16:13:32 +0100
committerPer Melin <git@melin.net>2024-02-15 14:33:47 +0100
commit27dc9fa4c0484ac4421b257d4986ea660fa432e6 (patch)
treec9685dcbdca3347daccca14f6e1f99f547140913 /editor/debugger/editor_visual_profiler.cpp
parent907db8eebcecb97d527edcaff77a1c87a6c068f5 (diff)
downloadredot-engine-27dc9fa4c0484ac4421b257d4986ea660fa432e6.tar.gz
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.
Diffstat (limited to 'editor/debugger/editor_visual_profiler.cpp')
-rw-r--r--editor/debugger/editor_visual_profiler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp
index 4ebed726c5..72f1060589 100644
--- a/editor/debugger/editor_visual_profiler.cpp
+++ b/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);