mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
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:
parent
f4290fc09c
commit
70597dbc0e
2 changed files with 18 additions and 3 deletions
|
|
@ -543,9 +543,12 @@ RegionMotionDrag::compute_x_delta (GdkEvent const * event, nframes64_t* pending_
|
|||
|
||||
/* x movement since last time */
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue