diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-21 00:15:43 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-21 00:15:43 +0000 |
commit | f58a810af82cba3510b718a99bcc2d5473c8abf5 (patch) | |
tree | 978a6188fd304b4207d5e29ef715e7409e298c41 /gtk2_ardour/automation_region_view.cc | |
parent | f9d88d09797e9ba1fa4a281e66e583d41da7e009 (diff) |
Clamp y for newly added automation line points.
git-svn-id: svn://localhost/ardour2/branches/3.0@7457 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_region_view.cc')
-rw-r--r-- | gtk2_ardour/automation_region_view.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index d403f0e90e..21ee6ca38a 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -97,6 +97,10 @@ AutomationRegionView::canvas_event(GdkEvent* ev) /* convert to item coordinates in the time axis view */ automation_view()->canvas_display()->w2i (x, y); + /* clamp y */ + y = max (y, 0.0); + y = min (y, _height - NAME_HIGHLIGHT_SIZE); + add_automation_event (ev, trackview.editor().pixel_to_frame (x) - _region->position(), y); } @@ -154,8 +158,9 @@ AutomationRegionView::set_height (double h) { RegionView::set_height(h); - if (_line) + if (_line) { _line->set_height ((uint32_t)rint(h - NAME_HIGHLIGHT_SIZE)); + } } bool |