return;
}
- double const h = trackview.current_height() / double (mv->contents_note_range ());
+ double const h = std::max(1., floor (trackview.current_height() / double (mv->contents_note_range ())) -1);
for (EventList::iterator it = events.begin(); it != events.end(); ++it) {
uint8_t const note_num = (*it)->event->note()->note();
} else {
const double y = mv->note_to_y(note_num);
event->rect->set_y0 (y);
- event->rect->set_y1 (y + mv->note_height());
+ event->rect->set_y1 (y + std::max(1., floor(mv->note_height()) -1));
}
}
}
if (Note* cnote = dynamic_cast<Note*>(event)) {
- const double y0 = midi_stream_view()->note_to_y(note->note());
- const double y1 = y0 + floor(midi_stream_view()->note_height());
+ const double y0 = 1. + floor (midi_stream_view()->note_to_y(note->note()));
+ const double y1 = y0 + std::max(1., floor(midi_stream_view()->note_height()) - 1.);
cnote->set_y0 (y0);
cnote->set_y1 (y1);
{
boost::shared_ptr<NoteType> note = ev->note();
const double x = trackview.editor().sample_to_pixel (source_beats_to_region_frames (note->time()));
- const double y0 = midi_stream_view()->note_to_y(note->note());
+ const double y0 = 1 + floor(midi_stream_view()->note_to_y(note->note()));
ev->set_x0 (x);
ev->set_y0 (y0);
ev->set_x1 (trackview.editor().sample_to_pixel (_region->length()));
}
- ev->set_y1 (y0 + floor(midi_stream_view()->note_height()));
+ ev->set_y1 (y0 + std::max(1., floor(midi_stream_view()->note_height()) - 1));
if (note->length() == 0) {
if (_active_notes && note->note() < 128) {
const framepos_t note_start_frames = source_beats_to_region_frames(note->time());
const double x = trackview.editor().sample_to_pixel(note_start_frames);
- const double diamond_size = midi_stream_view()->note_height();
- const double y = midi_stream_view()->note_to_y(note->note()) + (diamond_size/2.0);
+ const double diamond_size = std::max(1., floor(midi_stream_view()->note_height()) - 2.);
+ const double y = 1.5 + floor(midi_stream_view()->note_to_y(note->note())) + diamond_size * .5;
ev->set_position (ArdourCanvas::Duple (x, y));
ev->set_height (diamond_size);
} else if (midi_view()->note_mode() == Percussive) {
- const double diamond_size = midi_stream_view()->note_height() / 2.0;
+ const double diamond_size = std::max(1., floor(midi_stream_view()->note_height()) - 2.);
Hit* ev_diamond = new Hit (*this, _note_group, diamond_size, note);
void
PianoRollHeader::get_path(PianoRollHeader::ItemType note_type, int note, double x[], double y[])
{
- double y_pos = floor(_view.note_to_y(note)) - 0.5f;
+ double y_pos = floor(_view.note_to_y(note)) + 1.5f;
double note_height;
- double other_y1 = floor(_view.note_to_y(note+1)) + floor(_note_height / 2.0f) + 0.5f;
- double other_y2 = floor(_view.note_to_y(note-1)) + floor(_note_height / 2.0f) - 1.0f;
+ double other_y1 = floor(_view.note_to_y(note+1)) + floor(_note_height / 2.0f) + 2.5f;
+ double other_y2 = floor(_view.note_to_y(note-1)) + floor(_note_height / 2.0f) + 1.0f;
double width = get_width();
if (note == 0) {
- note_height = floor(_view.contents_height()) - y_pos;
+ note_height = floor(_view.contents_height()) - y_pos + 2.;
} else {
- note_height = floor(_view.note_to_y(note - 1)) - y_pos;
+ note_height = floor(_view.note_to_y(note - 1)) - y_pos + 2.;
}
switch (note_type) {