only switch pianroll to UserRange after a drag actually changed things

This commit is contained in:
Paul Davis
2025-10-09 16:24:54 -06:00
parent df564f132b
commit 6836c93f21
2 changed files with 10 additions and 1 deletions

View File

@@ -61,6 +61,7 @@ PianoRollHeaderBase::PianoRollHeaderBase (MidiViewBackground& bg)
, _dragging (false)
, _scroomer_size (60.f)
, _scroomer_drag (false)
, scroomer_did_drag (false)
, _old_y (0.0)
, _fract (0.0)
, _scroomer_state (NONE)
@@ -563,6 +564,7 @@ PianoRollHeaderBase::motion_handler (GdkEventMotion* ev)
_fract = (_fract + note_range > 127.0)? 127.0 - note_range : _fract;
_fract = max(0.0, _fract);
_adj.set_value (min(_fract, 127.0 - note_range));
scroomer_did_drag = true;
break;
case TOP:
@@ -578,6 +580,7 @@ PianoRollHeaderBase::motion_handler (GdkEventMotion* ev)
idle_range_move = MidiViewBackground::CanMoveTop;
if (!scroomer_drag_connection.connected()) {
scroomer_drag_connection = Glib::signal_idle().connect (sigc::mem_fun (*this, &PianoRollHeaderBase::idle_apply_range));
scroomer_did_drag = true;
}
}
break;
@@ -595,6 +598,7 @@ PianoRollHeaderBase::motion_handler (GdkEventMotion* ev)
idle_range_move = MidiViewBackground::CanMoveBottom;
if (!scroomer_drag_connection.connected()) {
scroomer_drag_connection = Glib::signal_idle().connect (sigc::mem_fun (*this, &PianoRollHeaderBase::idle_apply_range));
scroomer_did_drag = true;
}
}
break;
@@ -656,6 +660,7 @@ void
PianoRollHeaderBase::begin_scroomer_drag (double evy)
{
_scroomer_drag = true;
scroomer_did_drag = false;
_old_y = evy;
_fract = _adj.get_value();
_fract_top = _adj.get_value() + _adj.get_page_size();
@@ -665,7 +670,10 @@ void
PianoRollHeaderBase::end_scroomer_drag ()
{
_scroomer_drag = false;
_midi_context.set_note_visibility_range_style (MidiViewBackground::UserRange);
if (scroomer_did_drag) {
_midi_context.set_note_visibility_range_style (MidiViewBackground::UserRange);
}
scroomer_did_drag = false;
}
bool

View File

@@ -92,6 +92,7 @@ class PianoRollHeaderBase : virtual public sigc::trackable {
bool _dragging;
mutable double _scroomer_size;
bool _scroomer_drag;
bool scroomer_did_drag;
double _old_y;
double _fract;
double _fract_top;