summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ghostregion.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-09-08 18:44:32 +0200
committerRobin Gareus <robin@gareus.org>2014-09-08 18:44:32 +0200
commit1f313ec19c4c60de8ce4288c98f2632ee78fbcdc (patch)
treee1cde3077d92fa7d3bd1c8abc5811975ffcc2242 /gtk2_ardour/ghostregion.cc
parenta649fa85723ac0c6aa8724d1cb8cfef19e5c201e (diff)
Vertically align Midi Notes, Piano Roll & Canvas Line Grid
Diffstat (limited to 'gtk2_ardour/ghostregion.cc')
-rw-r--r--gtk2_ardour/ghostregion.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk2_ardour/ghostregion.cc b/gtk2_ardour/ghostregion.cc
index 759ffb94d2..2f9133803c 100644
--- a/gtk2_ardour/ghostregion.cc
+++ b/gtk2_ardour/ghostregion.cc
@@ -250,7 +250,7 @@ MidiGhostRegion::update_range ()
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();
@@ -285,7 +285,7 @@ MidiGhostRegion::add_note (NoteBase* n)
} 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));
}
}
}