# HG changeset patch # User matthiasm # Date 1402579908 -3600 # Node ID 0ba792bb235bfdbf11d4653ce41fdebf3d74bcc8 # Parent b076cefaf7084884dbe2afe1a5432d8a7fb8ec32 adding a note after the last existing one is now possible (#974) diff -r b076cefaf708 -r 0ba792bb235b layer/FlexiNoteLayer.cpp --- a/layer/FlexiNoteLayer.cpp Thu Jun 12 13:42:10 2014 +0100 +++ b/layer/FlexiNoteLayer.cpp Thu Jun 12 14:31:48 2014 +0100 @@ -1281,19 +1281,22 @@ long frame = v->getFrameForX(e->x()); float value = getValueForY(v, e->y()); + FlexiNoteModel::PointList noteList = m_model->getPoints(); + if (m_intelligentActions) { long smallestRightNeighbourFrame = 0; - for (FlexiNoteModel::PointList::const_iterator i = m_model->getPoints().begin(); - i != m_model->getPoints().end(); ++i) { + for (FlexiNoteModel::PointList::const_iterator i = noteList.begin(); + i != noteList.end(); ++i) { FlexiNote currentNote = *i; if (currentNote.frame > frame) { smallestRightNeighbourFrame = currentNote.frame; break; } } - - duration = std::min(smallestRightNeighbourFrame - frame + 1, duration); - duration = (duration > 0) ? duration : 0; + if (smallestRightNeighbourFrame > 0) { + duration = std::min(smallestRightNeighbourFrame - frame + 1, duration); + duration = (duration > 0) ? duration : 0; + } } if (!m_intelligentActions || diff -r b076cefaf708 -r 0ba792bb235b view/Overview.cpp --- a/view/Overview.cpp Thu Jun 12 13:42:10 2014 +0100 +++ b/view/Overview.cpp Thu Jun 12 14:31:48 2014 +0100 @@ -280,7 +280,7 @@ #ifdef DEBUG_OVERVIEW cerr << "Overview::mouseMoveEvent: x " << e->x() << " and click x " << m_clickPos.x() << " -> frame " << newCentreFrame << " -> rf " << rf << endl; #endif - emit centreFrameChanged(rf, true, PlaybackIgnore); + emit centreFrameChanged(rf, true, PlaybackScrollContinuous); } }