lollipops: try to make sure we use the right velocity when setting lolli heights (dragging vs. not dragging
This commit is contained in:
parent
bec4344546
commit
4ea676b855
@ -179,12 +179,12 @@ VelocityGhostRegion::add_note (NoteBase* nb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VelocityGhostRegion::set_size_and_position (GhostEvent& ev)
|
VelocityGhostRegion::set_size_and_position (GhostEvent& gev)
|
||||||
{
|
{
|
||||||
ArdourCanvas::Lollipop* l = dynamic_cast<ArdourCanvas::Lollipop*> (ev.item);
|
ArdourCanvas::Lollipop* l = dynamic_cast<ArdourCanvas::Lollipop*> (gev.item);
|
||||||
const double available_height = base_rect->y1();
|
const double available_height = base_rect->y1();
|
||||||
const double actual_height = (ev.velocity_while_editing / 127.0) * available_height;
|
const double actual_height = ((dragging ? gev.velocity_while_editing : gev.event->note()->velocity()) / 127.0) * available_height;
|
||||||
l->set (ArdourCanvas::Duple (ev.event->x0(), base_rect->y1() - actual_height), actual_height, lollipop_radius);
|
l->set (ArdourCanvas::Duple (gev.event->x0(), base_rect->y1() - actual_height), actual_height, lollipop_radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -370,6 +370,7 @@ VelocityGhostRegion::start_line_drag ()
|
|||||||
gev->velocity_while_editing = gev->event->note()->velocity();
|
gev->velocity_while_editing = gev->event->note()->velocity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dragging = true;
|
||||||
desensitize_lollis ();
|
desensitize_lollis ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,6 +379,8 @@ VelocityGhostRegion::end_line_drag (bool did_change)
|
|||||||
{
|
{
|
||||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (&parent_rv);
|
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (&parent_rv);
|
||||||
|
|
||||||
|
dragging = false;
|
||||||
|
|
||||||
if (did_change) {
|
if (did_change) {
|
||||||
std::vector<NoteBase*> notes;
|
std::vector<NoteBase*> notes;
|
||||||
std::vector<int> velocities;
|
std::vector<int> velocities;
|
||||||
|
Loading…
Reference in New Issue
Block a user