summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-12-27 00:22:26 +0000
committerCarl Hetherington <carl@carlh.net>2011-12-27 00:22:26 +0000
commitfd48e72fc212a0f7a2cb23a7c39ccc0f76cb7439 (patch)
treec426fcd69cde517f9422cc2db9143e3f4cc23933 /gtk2_ardour
parentd771ca6b0e67d54d96378b69480e7dd291a73dc3 (diff)
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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/midi_region_view.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 6b65bb26b8..43532f145c 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -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();