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
@@ -586,7 +586,7 @@ void TimelineView::DrawBlock(QPainter *painter, bool foreground, Block *block, q
if (marker->time().in() >= clip->media_in() && marker->time().out() <= clip->media_in() + clip->length()) {
QPoint marker_pt(TimeToScene(clip->in() - clip->media_in() + marker->time().in()), block_top + block_height);
painter->setClipRect(r);
QRect marker_rect = marker->Draw(painter, marker_pt, GetScale(), false);
QRect marker_rect = marker->Draw(painter, marker_pt, -1, GetScale(), false);
clip_marker_rects_.insert(marker, marker_rect);
painter->setClipping(false);
}
+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);
}