fixed #93
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.6.2, 2018-06-30T19:57:23. -->
|
||||
<!-- Written by QtCreator 4.6.2, 2018-06-30T21:54:35. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
||||
@@ -468,7 +468,39 @@ void Timeline::split_clip_and_relink(Clip* clip, long frame, bool relink) {
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::clean_up_selections(QVector<Selection>& areas) {
|
||||
for (int i=0;i<areas.size();i++) {
|
||||
Selection& s = areas[i];
|
||||
for (int j=0;j<areas.size();j++) {
|
||||
if (i != j) {
|
||||
Selection& ss = areas[j];
|
||||
if (s.track == ss.track) {
|
||||
bool remove = false;
|
||||
if (s.in < ss.in && s.out > ss.out) {
|
||||
// do nothing
|
||||
} else if (s.in >= ss.in && s.out <= ss.out) {
|
||||
remove = true;
|
||||
} else if (s.in <= ss.out && s.out > ss.out) {
|
||||
ss.out = s.out;
|
||||
remove = true;
|
||||
} else if (s.out >= ss.in && s.in < ss.in) {
|
||||
ss.in = s.in;
|
||||
remove = true;
|
||||
}
|
||||
if (remove) {
|
||||
areas.removeAt(i);
|
||||
i--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::delete_areas_and_relink(QVector<Selection>& areas) {
|
||||
clean_up_selections(areas);
|
||||
|
||||
QVector<Clip*> pre_clips;
|
||||
QVector<Clip*> post_clips;
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
bool split_selection();
|
||||
void split_at_playhead();
|
||||
void split_clip_and_relink(Clip* clip, long frame, bool relink);
|
||||
void clean_up_selections(QVector<Selection>& areas);
|
||||
void delete_areas_and_relink(QVector<Selection>& areas);
|
||||
void relink_clips_using_ids(QVector<Clip*>& old_clips, QVector<Clip*>& new_clips);
|
||||
void update_sequence();
|
||||
|
||||
@@ -111,9 +111,11 @@ void Sequence::undo_add_current() {
|
||||
QVector<Clip*>* copied_clips = new QVector<Clip*>();
|
||||
for (int i=0;i<clip_count();i++) {
|
||||
Clip* original = get_clip(i);
|
||||
Clip* copy = original->copy();
|
||||
copy->linked = original->linked;
|
||||
copied_clips->append(copy);
|
||||
if (original != NULL) {
|
||||
Clip* copy = original->copy();
|
||||
copy->linked = original->linked;
|
||||
copied_clips->append(copy);
|
||||
}
|
||||
}
|
||||
undo_stack.append(copied_clips);
|
||||
}
|
||||
|
||||
+2
-29
@@ -349,35 +349,8 @@ void TimelineWidget::mouseReleaseEvent(QMouseEvent *event) {
|
||||
panel_timeline->redraw_all_clips(true);
|
||||
} else if (panel_timeline->selecting) {
|
||||
// remove duplicate selections
|
||||
for (int i=0;i<panel_timeline->selections.size();i++) {
|
||||
Selection& s = panel_timeline->selections[i];
|
||||
for (int j=0;j<panel_timeline->selections.size();j++) {
|
||||
if (i != j) {
|
||||
Selection& ss = panel_timeline->selections[j];
|
||||
if (s.track == ss.track) {
|
||||
bool remove = false;
|
||||
if (s.in < ss.in && s.out > ss.out) {
|
||||
// do nothing
|
||||
} else if (s.in >= ss.in && s.out <= ss.out) {
|
||||
remove = true;
|
||||
} else if (s.in <= ss.out && s.out > ss.out) {
|
||||
ss.out = s.out;
|
||||
remove = true;
|
||||
} else if (s.out >= ss.in && s.in < ss.in) {
|
||||
ss.in = s.in;
|
||||
remove = true;
|
||||
}
|
||||
if (remove) {
|
||||
panel_timeline->selections.removeAt(i);
|
||||
i--;
|
||||
repaint = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
panel_timeline->clean_up_selections(panel_timeline->selections);
|
||||
repaint = true;
|
||||
}
|
||||
|
||||
// destroy all ghosts
|
||||
|
||||
Reference in New Issue
Block a user