From ee893a10e7e1560f1d705a3ccf6f7ed228d47c5c Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Fri, 17 Feb 2023 02:38:39 +0100 Subject: [PATCH] Fix #90389: No labels in scrubbing area with small FPS Maximum distance of lines in screen space is limited. This limit seems reasonable for FPS higher than 1, but UI allows to set 0.01 FPS with soft. even lower values are possible. This patch allows for normal operation within soft limits and labels are still visible and quite usable within hard limits. ---- At about 1/4000 FPS label values starts to overflow, but this is not effect of this patch. --- .../blender/editors/interface/view2d_draw.cc | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/source/blender/editors/interface/view2d_draw.cc b/source/blender/editors/interface/view2d_draw.cc index 837d7de1c86..c20ad465748 100644 --- a/source/blender/editors/interface/view2d_draw.cc +++ b/source/blender/editors/interface/view2d_draw.cc @@ -102,17 +102,16 @@ static float view2d_major_step_x__time(const View2D *v2d, const Scene *scene) for (int step = 1; step < fps; step *= 2) { possible_distances.append(step); } - possible_distances.append(fps); - possible_distances.append(2 * fps); - possible_distances.append(5 * fps); - possible_distances.append(10 * fps); - possible_distances.append(30 * fps); - possible_distances.append(60 * fps); - possible_distances.append(2 * 60 * fps); - possible_distances.append(5 * 60 * fps); - possible_distances.append(10 * 60 * fps); - possible_distances.append(30 * 60 * fps); - possible_distances.append(60 * 60 * fps); + + for (int i = 0; i <= 5; i++) { + uint fac = pow(60, i); + possible_distances.append(fac * fps); + possible_distances.append(fac * 2 * fps); + possible_distances.append(fac * 5 * fps); + possible_distances.append(fac * 10 * fps); + possible_distances.append(fac * 30 * fps); + possible_distances.append(fac * 60 * fps); + } float distance = select_major_distance(possible_distances.data(), possible_distances.size(), -- 2.30.2