mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Fix two ghost note drawing problems.
A ghost note could appear: 1) above the region. 2) inside another note even though we haven't yet entered it.
This commit is contained in:
parent
76237a696c
commit
39bd216725
1 changed files with 3 additions and 2 deletions
|
|
@ -619,7 +619,7 @@ MidiStreamView::update_rec_box ()
|
||||||
uint8_t
|
uint8_t
|
||||||
MidiStreamView::y_to_note (double y) const
|
MidiStreamView::y_to_note (double y) const
|
||||||
{
|
{
|
||||||
int const n = ((contents_height() - y - 1) / contents_height() * (double)contents_note_range())
|
int const n = ((contents_height() - y) / contents_height() * (double)contents_note_range())
|
||||||
+ lowest_note();
|
+ lowest_note();
|
||||||
|
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
|
|
@ -628,7 +628,8 @@ MidiStreamView::y_to_note (double y) const
|
||||||
return 127;
|
return 127;
|
||||||
}
|
}
|
||||||
|
|
||||||
return n;
|
/* min due to rounding and/or off-by-one errors */
|
||||||
|
return min ((uint8_t) n, highest_note());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Suspend updates to the regions' note ranges and our
|
/** Suspend updates to the regions' note ranges and our
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue