1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 08:09:32 +02:00

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.
This commit is contained in:
lllucius 2013-10-23 22:51:57 +00:00
parent b3c2f486d2
commit 7bb67e33fd

View File

@ -18,6 +18,11 @@
#include "WaveTrack.h" #include "WaveTrack.h"
#include "widgets/TimeTextCtrl.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) static int CompareSnapPoints(SnapPoint *s1, SnapPoint *s2)
{ {
return (s1->t - s2->t > 0? 1 : -1); return (s1->t - s2->t > 0? 1 : -1);
@ -249,7 +254,7 @@ bool SnapManager::Snap(Track *currentTrack,
} }
else { else {
// Snap time to the grid // Snap time to the grid
mConverter.ValueToControls(t, false); mConverter.ValueToControls(t, SNAP_TO_NEAREST);
mConverter.ControlsToValue(); mConverter.ControlsToValue();
*out_t = mConverter.GetTimeValue(); *out_t = mConverter.GetTimeValue();
*snappedTime = true; *snappedTime = true;