summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_streamview.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-03-07 17:17:11 +0000
committerCarl Hetherington <carl@carlh.net>2011-03-07 17:17:11 +0000
commite64486acfad5c366f33d13ccd9b1303e0767fbe9 (patch)
tree236cd43311fd7d86a5ef153800f7412eaf62a5be /gtk2_ardour/midi_streamview.h
parent0d40ff55c8d0137019bf2f62945ef981238c32fc (diff)
Clamp output of y_to_note so that it doesn't return out-of-range values. Should fix #3823.
git-svn-id: svn://localhost/ardour2/branches/3.0@9096 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_streamview.h')
-rw-r--r--gtk2_ardour/midi_streamview.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/gtk2_ardour/midi_streamview.h b/gtk2_ardour/midi_streamview.h
index 0774fd61bd..a939d8ea7d 100644
--- a/gtk2_ardour/midi_streamview.h
+++ b/gtk2_ardour/midi_streamview.h
@@ -83,10 +83,7 @@ class MidiStreamView : public StreamView
{ return contents_height()
- (note + 1 - lowest_note()) * note_height() + 1; }
- inline uint8_t y_to_note(double y) const
- { return (uint8_t)((contents_height() - y - 1)
- / contents_height() * (double)contents_note_range())
- + lowest_note(); }
+ uint8_t y_to_note(double y) const;
inline double note_height() const
{ return contents_height() / (double)contents_note_range(); }