timeline: show marker text even on markers without range

This commit is contained in:
itsmattkc
2022-07-19 11:21:06 -07:00
parent 35bc52ee47
commit 46be693b3e
4 changed files with 30 additions and 5 deletions
+11 -1
View File
@@ -277,7 +277,17 @@ void SeekableWidget::DrawMarkers(QPainter *p, int marker_bottom)
break;
}
QRect marker_rect = marker->Draw(p, QPoint(marker_left, marker_bottom), GetScale(), selection_manager_.IsSelected(marker));
int max_marker_right = lim_right;
{
// Check if there's a marker next
auto next = it;
next++;
if (next != markers_->cend()) {
max_marker_right = std::min(max_marker_right, int(TimeToScene((*next)->time().in())));
}
}
QRect marker_rect = marker->Draw(p, QPoint(marker_left, marker_bottom), max_marker_right, GetScale(), selection_manager_.IsSelected(marker));
marker_top_ = marker_rect.top();
selection_manager_.DeclareDrawnObject(marker, marker_rect);
}