summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ghostregion.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-10-21 14:05:41 +0200
committerRobin Gareus <robin@gareus.org>2014-10-21 14:05:41 +0200
commit4cde08cdb86d9b41454e02e7757e9f125a04a326 (patch)
tree9cbde4617c84b8170951e28c04518436c0e320ac /gtk2_ardour/ghostregion.cc
parent58fec98a4dcef6eba6ad11d651576954dc03415b (diff)
fix midi-ghost region y-scale
Diffstat (limited to 'gtk2_ardour/ghostregion.cc')
-rw-r--r--gtk2_ardour/ghostregion.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk2_ardour/ghostregion.cc b/gtk2_ardour/ghostregion.cc
index 2f9133803c..ec062155cb 100644
--- a/gtk2_ardour/ghostregion.cc
+++ b/gtk2_ardour/ghostregion.cc
@@ -251,6 +251,7 @@ MidiGhostRegion::update_range ()
}
double const h = std::max(1., floor (trackview.current_height() / double (mv->contents_note_range ())) -1);
+ double const s = trackview.current_height() / double (mv->contents_note_range ());
for (EventList::iterator it = events.begin(); it != events.end(); ++it) {
uint8_t const note_num = (*it)->event->note()->note();
@@ -259,7 +260,7 @@ MidiGhostRegion::update_range ()
(*it)->rect->hide();
} else {
(*it)->rect->show();
- double const y = trackview.current_height() - (note_num + 1 - mv->lowest_note()) * h + 1;
+ double const y = trackview.current_height() - (note_num + 1 - mv->lowest_note()) * s;
(*it)->rect->set_y0 (y);
(*it)->rect->set_y1 (y + h);
}