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 | |
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
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 9 | ||||
-rw-r--r-- | gtk2_ardour/automation_region_view.cc | 7 |
2 files changed, 10 insertions, 6 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 94d5a4d8d4..9cc879c3ff 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -299,12 +299,11 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) bool ARDOUR_UI::run_startup (bool should_be_new, string load_template) { - if (_startup == 0) { - _startup = new ArdourStartup (); - } - - XMLNode* audio_setup = Config->extra_xml ("AudioSetup"); + delete _startup; + _startup = new ArdourStartup (); + XMLNode* audio_setup = Config->extra_xml ("AudioSetup"); + if (audio_setup && _startup->engine_control()) { _startup->engine_control()->set_state (*audio_setup); } 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 |