comparison view/Pane.cpp @ 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 26da827e8fb5
children 36cddc3de023 e297b7d752f2
comparison
equal deleted inserted replaced
927:271e729c818b 928:3fb91da7d98d
22 #include "ViewManager.h" 22 #include "ViewManager.h"
23 #include "widgets/CommandHistory.h" 23 #include "widgets/CommandHistory.h"
24 #include "widgets/TextAbbrev.h" 24 #include "widgets/TextAbbrev.h"
25 #include "base/Preferences.h" 25 #include "base/Preferences.h"
26 #include "layer/WaveformLayer.h" 26 #include "layer/WaveformLayer.h"
27 #include "layer/TimeRulerLayer.h"
27 28
28 // GF: added so we can propagate the mouse move event to the note layer for context handling. 29 // GF: added so we can propagate the mouse move event to the note layer for context handling.
29 #include "layer/LayerFactory.h" 30 #include "layer/LayerFactory.h"
30 #include "layer/FlexiNoteLayer.h" 31 #include "layer/FlexiNoteLayer.h"
31 32
1365 sv_frame_t mouseFrame = getFrameForX(e->x()); 1366 sv_frame_t mouseFrame = getFrameForX(e->x());
1366 int resolution = 1; 1367 int resolution = 1;
1367 sv_frame_t snapFrame = mouseFrame; 1368 sv_frame_t snapFrame = mouseFrame;
1368 1369
1369 Layer *layer = getInteractionLayer(); 1370 Layer *layer = getInteractionLayer();
1370 if (layer && !m_shiftPressed) { 1371 if (layer && !m_shiftPressed &&
1372 !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs
1371 layer->snapToFeatureFrame(this, snapFrame, 1373 layer->snapToFeatureFrame(this, snapFrame,
1372 resolution, Layer::SnapLeft); 1374 resolution, Layer::SnapLeft);
1373 } 1375 }
1374 1376
1375 if (snapFrame < 0) snapFrame = 0; 1377 if (snapFrame < 0) snapFrame = 0;
2081 int resolution = 1; 2083 int resolution = 1;
2082 sv_frame_t snapFrameLeft = mouseFrame; 2084 sv_frame_t snapFrameLeft = mouseFrame;
2083 sv_frame_t snapFrameRight = mouseFrame; 2085 sv_frame_t snapFrameRight = mouseFrame;
2084 2086
2085 Layer *layer = getInteractionLayer(); 2087 Layer *layer = getInteractionLayer();
2086 if (layer && !m_shiftPressed) { 2088 if (layer && !m_shiftPressed &&
2089 !qobject_cast<TimeRulerLayer *>(layer)) { // don't snap to secs
2087 layer->snapToFeatureFrame(this, snapFrameLeft, 2090 layer->snapToFeatureFrame(this, snapFrameLeft,
2088 resolution, Layer::SnapLeft); 2091 resolution, Layer::SnapLeft);
2089 layer->snapToFeatureFrame(this, snapFrameRight, 2092 layer->snapToFeatureFrame(this, snapFrameRight,
2090 resolution, Layer::SnapRight); 2093 resolution, Layer::SnapRight);
2091 } 2094 }