From 8b1f7a696df41cb6755a7be385cd7bd4411195d7 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 15 Dec 2021 12:27:51 -0600 Subject: [PATCH] triggerbox: TriggerMaster widget: better loop-progress indication --- gtk2_ardour/trigger_master.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/trigger_master.cc b/gtk2_ardour/trigger_master.cc index 4f485d8293..175fed4ed3 100644 --- a/gtk2_ardour/trigger_master.cc +++ b/gtk2_ardour/trigger_master.cc @@ -66,9 +66,10 @@ Loopster::set_fraction (float f) f = std::max(0.f, f); f = std::min(1.f, f); - float thresh = 1.0/nslices; - thresh *= 0.7; - if (fabs(_fraction-f)>thresh) { + float prior_slice = floor(_fraction * nslices); + float new_slice = floor(f*nslices); + + if (new_slice != prior_slice) { _fraction = f; redraw(); }