+ // Check no clip in the group goes outside of existing tracks
+ int maximumTrack = projectScene()->tracksCount() - 1;
+ int groupHeight = 0;
+ for (int i = 0; i < groupTracks.count(); ++i) {
+ int offset = groupTracks.at(i) - topTrack;
+ if (offset > groupHeight) groupHeight = offset;
+ }
+ maximumTrack -= groupHeight;
+ proposedTrack = qMin(proposedTrack, maximumTrack);
+ proposedTrack = qMax(proposedTrack, 0);
+ int groupOffset = proposedTrack - topTrack;
+ if (!lockedTracks.isEmpty()) {
+ for (int i = 0; i < groupTracks.count(); ++i) {
+ if (lockedTracks.contains(QString::number(groupTracks.at(i) + groupOffset))) {
+ return pos();
+ }
+ }
+ }