Fix zoom-dependent error in snap code.

pull/3/head
Jonathan Moore Liles 2008-05-31 20:13:18 -05:00
parent 54fe22e2d4
commit e48c429fd6
1 changed files with 4 additions and 4 deletions

View File

@ -525,15 +525,15 @@ prev_next_line_cb ( nframes_t frame, const BBT &bbt, void *arg )
bool
Timeline::nearest_line ( nframes_t *frame ) const
{
if ( snap_to == None )
if ( None == Timeline::snap_to )
return false;
nframes_t when = *frame;
nearest_line_arg n = { when, -1, Timeline::snap_to == Timeline::Bars };
nearest_line_arg n = { when, -1, Timeline::Bars == Timeline::snap_to };
render_tempomap( when - x_to_ts( w() >> 1 ), x_to_ts( w() ), nearest_line_cb, &n );
render_tempomap( when > x_to_ts( w() >> 1 ) ? when - x_to_ts( w() >> 1 ) : 0,
when + x_to_ts( w() >> 1 ), nearest_line_cb, &n );
if ( n.closest == (nframes_t)-1 )
return false;