From 4ea676b855e818a63ae37127d0160615996e5f65 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 27 Oct 2023 14:11:27 -0600 Subject: [PATCH] lollipops: try to make sure we use the right velocity when setting lolli heights (dragging vs. not dragging --- gtk2_ardour/velocity_ghost_region.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/velocity_ghost_region.cc b/gtk2_ardour/velocity_ghost_region.cc index 7c1b88ebe5..058e56e1e3 100644 --- a/gtk2_ardour/velocity_ghost_region.cc +++ b/gtk2_ardour/velocity_ghost_region.cc @@ -179,12 +179,12 @@ VelocityGhostRegion::add_note (NoteBase* nb) } void -VelocityGhostRegion::set_size_and_position (GhostEvent& ev) +VelocityGhostRegion::set_size_and_position (GhostEvent& gev) { - ArdourCanvas::Lollipop* l = dynamic_cast (ev.item); + ArdourCanvas::Lollipop* l = dynamic_cast (gev.item); const double available_height = base_rect->y1(); - const double actual_height = (ev.velocity_while_editing / 127.0) * available_height; - l->set (ArdourCanvas::Duple (ev.event->x0(), base_rect->y1() - actual_height), actual_height, lollipop_radius); + const double actual_height = ((dragging ? gev.velocity_while_editing : gev.event->note()->velocity()) / 127.0) * available_height; + l->set (ArdourCanvas::Duple (gev.event->x0(), base_rect->y1() - actual_height), actual_height, lollipop_radius); } void @@ -370,6 +370,7 @@ VelocityGhostRegion::start_line_drag () gev->velocity_while_editing = gev->event->note()->velocity(); } + dragging = true; desensitize_lollis (); } @@ -378,6 +379,8 @@ VelocityGhostRegion::end_line_drag (bool did_change) { MidiRegionView* mrv = dynamic_cast (&parent_rv); + dragging = false; + if (did_change) { std::vector notes; std::vector velocities;