summaryrefslogtreecommitdiff
path: root/gtk2_ardour/automation_line.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-07-13 19:24:46 +0000
committerCarl Hetherington <carl@carlh.net>2011-07-13 19:24:46 +0000
commit5f9fb85b7763796cb2894aac96317e40ca2b3c43 (patch)
tree4ce6fa3fe82c2c081546e0141500df3e026608e5 /gtk2_ardour/automation_line.cc
parent80972784e348aa51522e562b3d6b250745c489f0 (diff)
Fix crash when selecting automation points in MIDI
regions with non-zero starts (#4177) and also fix problems with selection conversions between ControlPoints and PointSelection in similar regions. git-svn-id: svn://localhost/ardour2/branches/3.0@9866 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r--gtk2_ardour/automation_line.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index 979b969621..5e5d511250 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -973,7 +973,7 @@ AutomationLine::get_selectables (
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
double const model_when = (*(*i)->model())->when;
- framepos_t const session_frames_when = _time_converter.to (model_when - _offset) + _time_converter.origin_b ();
+ framepos_t const session_frames_when = _time_converter.to (model_when) + _time_converter.origin_b () - _offset;
if (session_frames_when >= start && session_frames_when <= end && (*i)->get_y() >= bot_track && (*i)->get_y() <= top_track) {
results.push_back (*i);
@@ -1004,8 +1004,8 @@ AutomationLine::point_selection_to_control_points (PointSelection const & s)
for (vector<ControlPoint*>::iterator j = control_points.begin(); j != control_points.end(); ++j) {
- double const rstart = trackview.editor().frame_to_unit (_time_converter.to (i->start));
- double const rend = trackview.editor().frame_to_unit (_time_converter.to (i->end));
+ double const rstart = trackview.editor().frame_to_unit (_time_converter.to (i->start) - _offset);
+ double const rend = trackview.editor().frame_to_unit (_time_converter.to (i->end) - _offset);
if ((*j)->get_x() >= rstart && (*j)->get_x() <= rend) {
if ((*j)->get_y() >= bot && (*j)->get_y() <= top) {
@@ -1020,7 +1020,7 @@ AutomationLine::point_selection_to_control_points (PointSelection const & s)
}
void
-AutomationLine::set_selected_points (PointSelection& points)
+AutomationLine::set_selected_points (PointSelection const & points)
{
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
(*i)->set_selected (false);