aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2015-07-19 20:38:11 +0200
committerJean-Baptiste Mardelle <[email protected]>2015-07-19 20:38:11 +0200
commit7a05ad2d8f155410fe689641c9e4dc3ab53d14b8 (patch)
tree82de8abf7a2cca760d3dd9335dd2a43a1ac44f29
parent601ddb959f9f76ec015e4b636e3b7bb86cd83a8a (diff)
Fix transitions broken (were applied on wrong track after recent timeline refactoring)
-rw-r--r--src/project/transitionsettings.cpp5
-rw-r--r--src/timeline/customtrackview.cpp10
2 files changed, 7 insertions, 8 deletions
diff --git a/src/project/transitionsettings.cpp b/src/project/transitionsettings.cpp
index 2a01fc1..5c0f9f8 100644
--- a/src/project/transitionsettings.cpp
+++ b/src/project/transitionsettings.cpp
@@ -136,9 +136,8 @@ void TransitionSettings::updateTrackList()
QIcon videoIcon = QIcon::fromTheme("kdenlive-show-video");
QIcon audioIcon = QIcon::fromTheme("kdenlive-show-audio");
for (int i = limit; i < m_tracks.count(); ++i) {
- int ix = m_tracks.count() - i - 1;
- transitionTrack->addItem(m_tracks.at(ix).type == VideoTrack ? videoIcon : audioIcon,
- m_tracks.at(ix).trackName.isEmpty() ? QString::number(i) : m_tracks.at(ix).trackName + " (" + QString::number(i) + ')',
+ transitionTrack->addItem(m_tracks.at(i).type == VideoTrack ? videoIcon : audioIcon,
+ m_tracks.at(i).trackName.isEmpty() ? QString::number(i) : m_tracks.at(i).trackName,
m_tracks.count() - i);
}
transitionTrack->addItem(i18n("Black"), 0);
diff --git a/src/timeline/customtrackview.cpp b/src/timeline/customtrackview.cpp
index 95059db..f9358c6 100644
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@ -349,12 +349,11 @@ void CustomTrackView::setOperation(OperationType op)
int CustomTrackView::getPreviousVideoTrack(int track)
{
- track = m_timeline->tracksCount() - track - 1;
- track --;
- for (int i = track; i > -1; --i) {
- if (m_timeline->getTrackInfo(i).type == VideoTrack) return i + 1;
+ int i = track + 1;
+ for (; i < m_timeline->tracksCount(); i++) {
+ if (m_timeline->getTrackInfo(i).type == VideoTrack) break;
}
- return 0;
+ return m_timeline->tracksCount() - i;
}
@@ -1206,6 +1205,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
info.startPos = m_dragItem->startPos();
info.track = m_dragItem->track();
int transitiontrack = getPreviousVideoTrack(info.track);
+ qDebug()<<" / / /ADDING TRANS ON TK: "<<transitiontrack;
ClipItem *transitionClip = NULL;
if (transitiontrack != 0) transitionClip = getClipItemAtStart(info.startPos, m_timeline->tracksCount() - transitiontrack);
if (transitionClip && transitionClip->endPos() < m_dragItem->endPos()) {