const double x0 = trackview.editor().sample_to_pixel (note_start_frames);
double x1;
const double y0 = 1 + floor(midi_stream_view()->note_to_y(note->note()));
- double y1;/* trim note display to not overlap the end of its region */
+ double y1;
+ /* trim note display to not overlap the end of its region */
if (note->length() > 0) {
Evoral::Beats note_end_time = note->end_time();
/* calculate time in beats relative to start of source */
const Evoral::Beats length = get_grid_beats(unsnapped_frame);
- const Evoral::Beats time = std::max(
+ const uint32_t divisions = editor.get_grid_music_divisions (0);
+
+ Evoral::Beats time = std::max(
Evoral::Beats(),
- absolute_frames_to_source_beats (f + _region->position ()));
+ Evoral::Beats (trackview.session()->tempo_map().exact_beat_at_frame (f + _region->position(), divisions))
+ - (_region->beat() - midi_region()->start_beats().to_double()));
_ghost_note->note()->set_time (time);
_ghost_note->note()->set_length (length);