Fix zone out snapping has a 1 frame offset

parent 58521006
......@@ -715,8 +715,7 @@ void Monitor::slotSetZoneStart()
void Monitor::slotSetZoneEnd()
{
int pos = m_glMonitor->getCurrentPos() + 1;
m_glMonitor->getControllerProxy()->setZoneOut(pos);
m_glMonitor->getControllerProxy()->setZoneOut(m_glMonitor->getCurrentPos() + 1);
if (m_controller) {
m_controller->setZone(m_glMonitor->getControllerProxy()->zone());
}
......
......@@ -140,11 +140,11 @@ void MonitorProxy::setZoneIn(int pos)
void MonitorProxy::setZoneOut(int pos)
{
if (m_zoneOut > 0) {
emit removeSnap(m_zoneOut);
emit removeSnap(m_zoneOut - 1);
}
m_zoneOut = pos;
if (pos > 0) {
emit addSnap(pos);
emit addSnap(m_zoneOut - 1);
}
emit zoneChanged();
emit saveZone();
......@@ -156,7 +156,7 @@ void MonitorProxy::setZone(int in, int out, bool sendUpdate)
emit removeSnap(m_zoneIn);
}
if (m_zoneOut > 0) {
emit removeSnap(m_zoneOut);
emit removeSnap(m_zoneOut - 1);
}
m_zoneIn = in;
m_zoneOut = out;
......@@ -164,7 +164,7 @@ void MonitorProxy::setZone(int in, int out, bool sendUpdate)
emit addSnap(m_zoneIn);
}
if (m_zoneOut > 0) {
emit addSnap(m_zoneOut);
emit addSnap(m_zoneOut - 1);
}
emit zoneChanged();
if (sendUpdate) {
......
......@@ -271,7 +271,7 @@ Item {
text: i18n("Out Point")
color: "white"
background: Rectangle {
color: "#ff4500"
color: "#770000"
}
padding: 4
horizontalAlignment: TextInput.AlignHCenter
......
......@@ -177,7 +177,7 @@ Item {
text: i18n("Out Point")
color: "white"
background: Rectangle {
color: "#ff4500"
color: "#770000"
}
padding: 5
horizontalAlignment: TextInput.AlignHCenter
......
......@@ -2724,7 +2724,7 @@ int TimelineModel::getNextSnapPos(int pos, std::vector<size_t> &snaps)
}
++it;
}
if (tracks.isEmpty()) {
if (tracks.isEmpty() || tracks.count() == (int) m_allTracks.size()) {
// No active track, use all possible snap points
return m_snaps->getNextPoint((int)pos);
}
......@@ -2757,7 +2757,7 @@ int TimelineModel::getPreviousSnapPos(int pos, std::vector<size_t> &snaps)
}
++it;
}
if (tracks.isEmpty()) {
if (tracks.isEmpty() || tracks.count() == (int) m_allTracks.size()) {
// No active track, use all possible snap points
return m_snaps->getPreviousPoint((int)pos);
}
......
......@@ -682,7 +682,7 @@ void TimelineController::gotoNextSnap()
{
std::vector<size_t> snaps = pCore->projectManager()->current()->getGuideModel()->getSnapPoints();
snaps.push_back(m_zone.x());
snaps.push_back(m_zone.y());
snaps.push_back(m_zone.y() - 1);
int nextSnap = m_model->getNextSnapPos(pCore->getTimelinePosition(), snaps);
if (nextSnap > pCore->getTimelinePosition()) {
setPosition(nextSnap);
......@@ -694,7 +694,7 @@ void TimelineController::gotoPreviousSnap()
if (pCore->getTimelinePosition() > 0) {
std::vector<size_t> snaps = pCore->projectManager()->current()->getGuideModel()->getSnapPoints();
snaps.push_back(m_zone.x());
snaps.push_back(m_zone.y());
snaps.push_back(m_zone.y() - 1);
setPosition(m_model->getPreviousSnapPos(pCore->getTimelinePosition(), snaps));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment