changeset 928:3fb91da7d98d tonioni

Don't snap selections to time ruler -- it's never useful
author Chris Cannam
date Tue, 24 Mar 2015 17:05:42 +0000
parents 271e729c818b
children 20698aa6a517
files view/Pane.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/view/Pane.cpp	Tue Mar 24 16:40:55 2015 +0000
+++ b/view/Pane.cpp	Tue Mar 24 17:05:42 2015 +0000
@@ -24,6 +24,7 @@
 #include "widgets/TextAbbrev.h"
 #include "base/Preferences.h"
 #include "layer/WaveformLayer.h"
+#include "layer/TimeRulerLayer.h"
 
 // GF: added so we can propagate the mouse move event to the note layer for context handling.
 #include "layer/LayerFactory.h"
@@ -1367,7 +1368,8 @@
             sv_frame_t snapFrame = mouseFrame;
     
             Layer *layer = getInteractionLayer();
-            if (layer && !m_shiftPressed) {
+            if (layer && !m_shiftPressed &&
+                !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs
                 layer->snapToFeatureFrame(this, snapFrame,
                                           resolution, Layer::SnapLeft);
             }
@@ -2083,7 +2085,8 @@
     sv_frame_t snapFrameRight = mouseFrame;
     
     Layer *layer = getInteractionLayer();
-    if (layer && !m_shiftPressed) {
+    if (layer && !m_shiftPressed &&
+        !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs
         layer->snapToFeatureFrame(this, snapFrameLeft,
                                   resolution, Layer::SnapLeft);
         layer->snapToFeatureFrame(this, snapFrameRight,