From 6c4c827575e9742a1114aa5f697b997f42bfb1d6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 4 Mar 2022 20:47:44 +0100 Subject: [PATCH] Fix snap, PH to prev/next grid --- gtk2_ardour/editor.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 9ba2a3214b..9493946467 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2952,8 +2952,15 @@ Editor::snap_to_bbt (timepos_t const & presnap, Temporal::RoundMode direction, S case GridTypeBeatDiv28: divisor = 7; break; + case GridTypeBar: + case GridTypeBeat: + divisor = 1; + break; + case GridTypeNone: + return ret; default: divisor = 2; + break; }; BBTRulerScale scale = bbt_ruler_scale; @@ -2963,10 +2970,12 @@ Editor::snap_to_bbt (timepos_t const & presnap, Temporal::RoundMode direction, S case bbt_show_16: case bbt_show_4: case bbt_show_1: - ret = timepos_t (tmap->quarters_at (tmap->round_to_bar (tmap->bbt_at (presnap)))); + /* Round to Bar */ + ret = timepos_t (tmap->quarters_at (presnap).round_to_subdivision (-1, direction)); break; case bbt_show_quarters: - ret = timepos_t (tmap->quarters_at (presnap).round_to_beat ()); + /* Round to Beat */ + ret = timepos_t (tmap->quarters_at (presnap).round_to_subdivision (1, direction)); break; case bbt_show_eighths: ret = timepos_t (tmap->quarters_at (presnap).round_to_subdivision (1 * divisor, direction));