Mercurial > hg > svgui
changeset 715:7169d08e9467 tonioni
Snapping to feature frame rightwards in flexi-note should snap to the end of a note as well as the start (should also snap to start of next one, but that doesn't seem to work either -- not enough points returned by getPoints). This should possibly happen in plain note and region layers too.
author | Chris Cannam |
---|---|
date | Fri, 10 Jan 2014 14:17:10 +0000 |
parents | 797eb48f38c1 |
children | 67b167bb60ab |
files | layer/FlexiNoteLayer.cpp |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp Fri Jan 10 14:07:12 2014 +0000 +++ b/layer/FlexiNoteLayer.cpp Fri Jan 10 14:17:10 2014 +0000 @@ -613,12 +613,18 @@ for (FlexiNoteModel::PointList::const_iterator i = points.begin(); i != points.end(); ++i) { + cerr << "FlexiNoteModel: point at " << i->frame << endl; + if (snap == SnapRight) { if (i->frame > frame) { snapped = i->frame; found = true; break; + } else if (i->frame + i->duration >= frame) { + snapped = i->frame + i->duration; + found = true; + break; } } else if (snap == SnapLeft) { @@ -654,6 +660,8 @@ } } + cerr << "snapToFeatureFrame: frame " << frame << " -> snapped " << snapped << ", found = " << found << endl; + frame = snapped; return found; }