From 7bb67e33fd072e427be93979e522894ed32befd8 Mon Sep 17 00:00:00 2001 From: lllucius Date: Wed, 23 Oct 2013 22:51:57 +0000 Subject: [PATCH] I accidentially included the patch for bug #647 along with the patch for bug #115. But, since there's some definite preferences on which is correct, I've left the change in, but added a simple way (SNAP_TO_NEAREST define in Snap.c) to change it once a decision is made. If set SNAP_TO_NEAREST back to true since that is the current (as of 2.0.5) behavior. --- src/Snap.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Snap.cpp b/src/Snap.cpp index 19b009229..648ccd50d 100644 --- a/src/Snap.cpp +++ b/src/Snap.cpp @@ -18,6 +18,11 @@ #include "WaveTrack.h" #include "widgets/TimeTextCtrl.h" +// Change this to "true" to snap to nearest and "false" to snap to previous +// As of 2013/10/23, defaulting to "true" until a decision is made on +// which method is prefered. +#define SNAP_TO_NEAREST false + static int CompareSnapPoints(SnapPoint *s1, SnapPoint *s2) { return (s1->t - s2->t > 0? 1 : -1); @@ -249,7 +254,7 @@ bool SnapManager::Snap(Track *currentTrack, } else { // Snap time to the grid - mConverter.ValueToControls(t, false); + mConverter.ValueToControls(t, SNAP_TO_NEAREST); mConverter.ControlsToValue(); *out_t = mConverter.GetTimeValue(); *snappedTime = true;