summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_streamview.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-09-08 18:43:52 +0200
committerRobin Gareus <robin@gareus.org>2014-09-08 18:43:52 +0200
commita649fa85723ac0c6aa8724d1cb8cfef19e5c201e (patch)
tree620aeb7ad54210fc890a82171248a664a7e3e9ec /gtk2_ardour/midi_streamview.cc
parent1c6c3514baaf5a8e99ff11c1fe19a3888ef877b2 (diff)
fix color of top-most MIDI note line on the canvas
Diffstat (limited to 'gtk2_ardour/midi_streamview.cc')
-rw-r--r--gtk2_ardour/midi_streamview.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc
index 97ce7ed939..55f4732a5c 100644
--- a/gtk2_ardour/midi_streamview.cc
+++ b/gtk2_ardour/midi_streamview.cc
@@ -288,7 +288,7 @@ MidiStreamView::draw_note_lines()
}
double y;
- double prev_y = 0;
+ double prev_y = .5;
uint32_t color;
_note_lines->clear();
@@ -302,15 +302,17 @@ MidiStreamView::draw_note_lines()
* coordinate system in which y=0 is at the top
*/
- for (int i = highest_note(); i >= lowest_note(); --i) {
+ for (int i = highest_note() + 1; i >= lowest_note(); --i) {
- y = note_to_y (i);
+ y = floor(note_to_y (i)) + .5;
/* this is the line actually corresponding to the division
* between notes
*/
- _note_lines->add (y, 1.0, ARDOUR_UI::config()->get_canvasvar_PianoRollBlackOutline());
+ if (i <= highest_note()) {
+ _note_lines->add (y, 1.0, ARDOUR_UI::config()->get_canvasvar_PianoRollBlackOutline());
+ }
/* now add a thicker line/bar which covers the entire vertical
* height of this note.
@@ -332,7 +334,7 @@ MidiStreamView::draw_note_lines()
double h = y - prev_y;
double mid = y + (h/2.0);
- if (height > 1.0) {
+ if (height > 1.0) { // XXX ? should that not be h >= 1 ?
_note_lines->add (mid, h, color);
}