diff view/Pane.cpp @ 1547:e6362cf5ff1d

Pass a y-coord, optionally, to Layer::snapToFeatureFrame. This is necessary for BoxLayer which needs to coordinate its snaps with the box it is highlighting for editing. Then in BoxLayer, merge getPointToDrag and getLocalPoints into a single getLocalPoint and use this throughout.
author Chris Cannam
date Thu, 17 Oct 2019 11:12:54 +0100
parents 35c7b7a592f0
children 0f36e0eca6b0
line wrap: on
line diff
--- a/view/Pane.cpp	Thu Oct 17 10:26:21 2019 +0100
+++ b/view/Pane.cpp	Thu Oct 17 11:12:54 2019 +0100
@@ -1440,7 +1440,7 @@
             if (layer && !m_shiftPressed &&
                 !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs
                 layer->snapToFeatureFrame(this, snapFrame,
-                                          resolution, Layer::SnapLeft);
+                                          resolution, Layer::SnapLeft, e->y());
             }
         
             if (snapFrame < 0) snapFrame = 0;
@@ -2173,9 +2173,9 @@
     if (layer && !m_shiftPressed &&
         !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs
         layer->snapToFeatureFrame(this, snapFrameLeft,
-                                  resolution, Layer::SnapLeft);
+                                  resolution, Layer::SnapLeft, e->y());
         layer->snapToFeatureFrame(this, snapFrameRight,
-                                  resolution, Layer::SnapRight);
+                                  resolution, Layer::SnapRight, e->y());
     }
         
 //        cerr << "snap: frame = " << mouseFrame << ", start frame = " << m_selectionStartFrame << ", left = " << snapFrameLeft << ", right = " << snapFrameRight << endl;