Skip to content

Commit

Permalink
fix(hiero): error when no track item to align
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Aug 9, 2022
1 parent 70d576b commit 0652050
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wulifang/hiero/track_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,14 @@ def _move_back():

def _compat_end_items():
out_max = max(i[1] for i in itervalues(self._m))
end_items = (i for i in track.items() if i.timelineIn() > out_max)
end_items = (i for i in track.items() if i.timelineOut() > out_max)
q = out_max
for i in end_items:
offset = q - i.timelineIn()
in_ = i.timelineIn()
if in_ < q:
q = i.timelineOut()
continue
offset = q - in_
assert offset < 0, "offset should be negative"
i.move(offset + 1)
q = i.timelineOut()
Expand Down

0 comments on commit 0652050

Please sign in to comment.