fixed ripple deleting empty space
This commit is contained in:
+7
-4
@@ -638,23 +638,26 @@ void Timeline::ripple_delete() {
|
||||
ComboAction* ca = new ComboAction();
|
||||
sequence_->DeleteAreas(ca, selections, true, true);
|
||||
olive::undo_stack.push(ca);
|
||||
repaint_timeline();
|
||||
|
||||
} else if (olive::config.hover_focus && get_focused_panel() == this) {
|
||||
|
||||
ComboAction* ca = new ComboAction();
|
||||
sequence_->RippleDeleteEmptySpace(ca, cursor_track, cursor_frame);
|
||||
olive::undo_stack.push(ca);
|
||||
ripple_delete_empty_space();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
repaint_timeline();
|
||||
|
||||
}
|
||||
|
||||
void Timeline::ripple_delete_empty_space()
|
||||
{
|
||||
if (sequence_ != nullptr) {
|
||||
ComboAction* ca = new ComboAction();
|
||||
sequence_->RippleDeleteEmptySpace(ca, cursor_track, cursor_frame);
|
||||
olive::undo_stack.push(ca);
|
||||
|
||||
repaint_timeline();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -801,11 +801,11 @@ void Sequence::RippleDeleteEmptySpace(ComboAction* ca, Track* track, long point)
|
||||
return;
|
||||
}
|
||||
|
||||
if (c->timeline_out() < point) {
|
||||
if (c->timeline_out() <= point) {
|
||||
|
||||
ripple_start = qMin(c->timeline_out(), ripple_start);
|
||||
|
||||
} else if (c->timeline_in() > point) {
|
||||
} else if (c->timeline_in() >= point) {
|
||||
|
||||
ripple_end = qMin(c->timeline_in(), ripple_end);
|
||||
|
||||
@@ -815,7 +815,11 @@ void Sequence::RippleDeleteEmptySpace(ComboAction* ca, Track* track, long point)
|
||||
// We now know the maximum ripple we could do to clear this empty space, but we need to ensure it won't cause
|
||||
// overlaps of clips in other tracks
|
||||
|
||||
RippleDeleteArea(ca, point, ripple_end - ripple_start);
|
||||
if (ripple_start == ripple_end) {
|
||||
return;
|
||||
}
|
||||
|
||||
RippleDeleteArea(ca, point, ripple_start - ripple_end);
|
||||
}
|
||||
|
||||
void Sequence::RippleDeleteArea(ComboAction* ca, long ripple_point, long ripple_length) {
|
||||
|
||||
Reference in New Issue
Block a user