mr.xval = (nframes_t) floor (cp.get_x());
mr.yval = 1.0 - (cp.get_y() / _height);
- /* if xval has not changed, set it directly from the model to avoid rounding errors */
+ /* if xval has not changed, set it directly from the model to avoid rounding errors */
if (mr.xval == trackview.editor.frame_to_unit((*cp.model)->when)) {
mr.xval = (nframes_t) (*cp.model)->when;
double tx = points[pi].x;
double ty = points[pi].y;
+
+ if (isnan (tx) || isnan (ty)) {
+ warning << string_compose (_("Ignoring illegal points on AutomationLine \"%1\""),
+ _name) << endmsg;
+ continue;
+ }
/* now ensure that the control_points vector reflects the current curve
state, but don't plot control points too close together. also, don't
line_drag_cp1 = i1;
line_drag_cp2 = i2;
+ //check if one of the control points on the line is in a selected range
+ bool range_found = false;
ControlPoint *cp;
-
for (uint32_t i = i1 ; i <= i2; i++) {
cp = nth (i);
- modify_view_point (*cp, trackview.editor.unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
+ if ( cp->selected )
+ range_found = true;
}
-
+
+ if (range_found) {
+ for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
+ if ( (*i)->selected ) {
+ modify_view_point (*(*i), trackview.editor.unit_to_frame ((*i)->get_x()), ((_height - (*i)->get_y()) /_height) + ydelta, with_push);
+ }
+ }
+ } else {
+ ControlPoint *cp;
+ for (uint32_t i = i1 ; i <= i2; i++) {
+ cp = nth (i);
+ modify_view_point (*cp, trackview.editor.unit_to_frame (cp->get_x()), ((_height - cp->get_y()) /_height) + ydelta, with_push);
+ }
+ }
+
if (line_points.size() > 1) {
line->property_points() = line_points;
}
void
AutomationLine::reset_callback (const AutomationList& events)
{
- ALPoints tmp_points;
+ ALPoints tmp_points;
uint32_t npoints = events.size();
if (npoints == 0) {
AutomationList::const_iterator ai;
for (ai = events.const_begin(); ai != events.const_end(); ++ai) {
-
+
double translated_y = (*ai)->value;
model_to_view_y (translated_y);