Fix drag from region list onto track.

git-svn-id: svn://localhost/ardour2/branches/3.0@7656 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-08-19 23:56:30 +00:00
parent f4290fc09c
commit 70597dbc0e
2 changed files with 18 additions and 3 deletions

View file

@ -545,7 +545,10 @@ RegionMotionDrag::compute_x_delta (GdkEvent const * event, nframes64_t* pending_
dx = (static_cast<double> (*pending_region_position) - _last_frame_position) / _editor->frames_per_unit;
/* total x movement */
framecnt_t total_dx = *pending_region_position - grab_frame () + _pointer_frame_offset;
framecnt_t total_dx = *pending_region_position;
if (regions_came_from_canvas()) {
total_dx = total_dx - grab_frame () + _pointer_frame_offset;
}
/* check that no regions have gone off the start of the session */
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
@ -774,7 +777,6 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
y_delta = rtv->view()->child_height () * pointer_layer_span;
}
if (_brushing) {
_editor->mouse_brush_insert_region (rv, pending_region_position);
} else {

View file

@ -255,6 +255,11 @@ public:
virtual void finished (GdkEvent *, bool) = 0;
virtual void aborted ();
/** @return true if the regions being `moved' came from somewhere on the canvas;
* false if they came from outside (e.g. from the region list).
*/
virtual bool regions_came_from_canvas () const = 0;
protected:
struct TimeAxisViewSummary {
TimeAxisViewSummary () : height_list(512) {}
@ -300,6 +305,10 @@ public:
void finished (GdkEvent *, bool);
void aborted ();
bool regions_came_from_canvas () const {
return true;
}
std::pair<nframes64_t, int> move_threshold () const {
return std::make_pair (4, 4);
}
@ -316,6 +325,10 @@ public:
void finished (GdkEvent *, bool);
void aborted ();
bool regions_came_from_canvas () const {
return false;
}
};
/** Region drag in splice mode */