fix #22917: Dragging bar lines to top or bottom staff lines requires extra precision
Merge pull request #823 from trig-ger/midi_fixes

MIDI import: further optimization and fixes