diff layer/NoteLayer.cpp @ 1428:c9fa16e41664 single-point

Update RegionLayer to updated RegionModel
author Chris Cannam
date Fri, 15 Mar 2019 14:24:22 +0000
parents f792a5001d80
children 5b9692768beb
line wrap: on
line diff
--- a/layer/NoteLayer.cpp	Fri Mar 15 11:09:17 2019 +0000
+++ b/layer/NoteLayer.cpp	Fri Mar 15 14:24:22 2019 +0000
@@ -545,6 +545,11 @@
         return true;
     }    
 
+    //!!! I think this is not quite right - we want to be able to snap
+    //!!! to events that are nearby but not covering the given frame,
+    //!!! and I think that worked with the old code. Compare and
+    //!!! revise.
+
     points = m_model->getEventsCovering(frame);
     sv_frame_t snapped = frame;
     bool found = false;
@@ -1212,8 +1217,6 @@
     for (EventVector::const_iterator i = points.begin();
          i != points.end(); ++i) {
 
-        Event p = *i;
-        
         sv_frame_t frame = 0;
 
         if (!realign) {
@@ -1230,6 +1233,7 @@
             }
         }
 
+        Event p = *i;
         Event newPoint = p;
         if (!p.hasValue()) {
             newPoint = newPoint.withValue((m_model->getValueMinimum() +