- this_delta_note = (int8_t)floor(dy / streamview->note_height() / 2.0);
- }
- drag_delta_note -= this_delta_note;
- dy = streamview->note_height() * this_delta_note;
- last_y = last_y + dy;
- }
-
- if (dx || dy) {
-
- CanvasNoteEvent* cnote = dynamic_cast<CanvasNoteEvent*>(_item);
- Evoral::MusicalTime new_time;
-
- if (drag_delta_x) {
- nframes64_t start_frames = region->beats_to_frames(cnote->note()->time());
- if (drag_delta_x >= 0) {
- start_frames += region->snap_frame_to_frame(_editor->pixel_to_frame(drag_delta_x));
- } else {
- start_frames -= region->snap_frame_to_frame(_editor->pixel_to_frame(-drag_delta_x));
- }
- new_time = region->frames_to_beats(start_frames);
- } else {
- new_time = cnote->note()->time();
- }
-
- boost::shared_ptr<Evoral::Note<Evoral::MusicalTime> > check_note (
- new Evoral::Note<Evoral::MusicalTime> (cnote->note()->channel(),
- new_time,
- cnote->note()->length(),
- cnote->note()->note() + drag_delta_note,
- cnote->note()->velocity()));