fix semi-random MIDI note separator line vanishing
This commit is contained in:
parent
4b15f94ccf
commit
85375397ed
@ -331,7 +331,7 @@ MidiStreamView::draw_note_lines()
|
|||||||
}
|
}
|
||||||
|
|
||||||
double y;
|
double y;
|
||||||
double prev_y = .5;
|
double prev_y = 0.;
|
||||||
uint32_t color;
|
uint32_t color;
|
||||||
|
|
||||||
ArdourCanvas::LineSet::ResetRAII lr (*_note_lines);
|
ArdourCanvas::LineSet::ResetRAII lr (*_note_lines);
|
||||||
@ -347,7 +347,7 @@ MidiStreamView::draw_note_lines()
|
|||||||
|
|
||||||
for (int i = highest_note() + 1; i >= lowest_note(); --i) {
|
for (int i = highest_note() + 1; i >= lowest_note(); --i) {
|
||||||
|
|
||||||
y = floor(note_to_y (i)) + .5;
|
y = floor (note_to_y (i));
|
||||||
|
|
||||||
/* this is the line actually corresponding to the division
|
/* this is the line actually corresponding to the division
|
||||||
* between notes
|
* between notes
|
||||||
@ -377,6 +377,14 @@ MidiStreamView::draw_note_lines()
|
|||||||
double h = y - prev_y;
|
double h = y - prev_y;
|
||||||
double mid = y + (h/2.0);
|
double mid = y + (h/2.0);
|
||||||
|
|
||||||
|
/* Cairo: odd width lines must be placed on 0.5 coordinates to be
|
||||||
|
* drawn correctly.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!fmod (h, 2.) && !fmod (mid, 1.)) {
|
||||||
|
mid += 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
if (mid >= 0 && h > 1.0) {
|
if (mid >= 0 && h > 1.0) {
|
||||||
_note_lines->add_coord (mid, h, color);
|
_note_lines->add_coord (mid, h, color);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user