13
0

Fix boundary condition first/last marker label length

This commit is contained in:
Robin Gareus 2024-05-08 19:16:07 +02:00
parent a0dc432e7a
commit c62fbc5c5b
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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;