From c62fbc5c5b3a84455c3e3dd9f985098f5f70dc6f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 8 May 2024 19:16:07 +0200 Subject: [PATCH] Fix boundary condition first/last marker label length --- gtk2_ardour/editor_markers.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 288550a1d1..e2858a3fbc 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -435,14 +435,19 @@ Editor::update_marker_labels (ArdourCanvas::Item* group) --pi; } - double const p = sample_to_pixel ((*pi)->position().distance ((*i)->position()).samples()); + double p = sample_to_pixel ((*pi)->position().distance ((*i)->position()).samples()); + + if (p == 0) { + p = DBL_MAX; + } if ((*prev)->label_on_left()) { (*i)->set_left_label_limit (p); } else { (*i)->set_left_label_limit (p / 2); } - + } else { + (*i)->set_left_label_limit (DBL_MAX); } while (next != sorted.end() && (*next)->position () == (*i)->position ()) { @@ -459,6 +464,8 @@ Editor::update_marker_labels (ArdourCanvas::Item* group) } ++next; + } else { + (*i)->set_right_label_limit (DBL_MAX); } prev = i;