13
0

Fix comparison of beats to frames when deciding whether to show a patch change (should fix #4569).

git-svn-id: svn://localhost/ardour2/branches/3.0@11085 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-12-27 00:22:26 +00:00
parent d771ca6b0e
commit fd48e72fc2

View File

@ -1677,7 +1677,8 @@ MidiRegionView::add_canvas_patch_change (MidiModel::PatchChangePtr patch, const
{
assert (patch->time() >= 0);
const double x = trackview.editor().frame_to_pixel (source_beats_to_region_frames (patch->time()));
framecnt_t region_frames = source_beats_to_region_frames (patch->time());
const double x = trackview.editor().frame_to_pixel (region_frames);
double const height = midi_stream_view()->contents_height();
@ -1692,7 +1693,7 @@ MidiRegionView::add_canvas_patch_change (MidiModel::PatchChangePtr patch, const
);
// Show unless patch change is beyond the region bounds
if (patch->time() - _region->start() >= _region->length() || patch->time() < _region->start()) {
if (region_frames < 0 || region_frames >= _region->length()) {
patch_change->hide();
} else {
patch_change->show();