Vertically align Midi Notes, Piano Roll & Canvas Line Grid

This commit is contained in:
Robin Gareus 2014-09-08 18:44:32 +02:00
parent a649fa8572
commit 1f313ec19c
3 changed files with 14 additions and 14 deletions

View file

@ -174,16 +174,16 @@ render_dga(Cairo::RefPtr<Cairo::Context> cr, int /*note*/, double x[], double y[
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) {