Don't add trailing break gap after last block on a track

This commit is contained in:
Ian Gulliver
2026-02-20 17:22:11 -07:00
parent fd0687f2af
commit 0bfa11c640

View File

@@ -187,6 +187,11 @@ func (tl *Timeline) findCell(blockID, event string) *TimelineCell {
} }
func (tl *Timeline) buildCells(endChains map[string]bool) { func (tl *Timeline) buildCells(endChains map[string]bool) {
lastOnTrack := map[string]*Block{}
for _, block := range tl.show.Blocks {
lastOnTrack[tl.Blocks[block.ID].Track] = block
}
for _, block := range tl.show.Blocks { for _, block := range tl.show.Blocks {
track := tl.trackIdx[tl.Blocks[block.ID].Track] track := tl.trackIdx[tl.Blocks[block.ID].Track]
var cells []*TimelineCell var cells []*TimelineCell
@@ -197,7 +202,7 @@ func (tl *Timeline) buildCells(endChains map[string]bool) {
cells = getBlockCells(block) cells = getBlockCells(block)
} }
track.appendCells(cells...) track.appendCells(cells...)
if block.Type != "cue" && !endChains[block.ID] { if block.Type != "cue" && !endChains[block.ID] && lastOnTrack[block.Track] != block {
track.appendCells(&TimelineCell{IsGap: true, IsBreak: true}) track.appendCells(&TimelineCell{IsGap: true, IsBreak: true})
} }
} }