mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +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 */
|
/* x movement since last time */
|
||||||
dx = (static_cast<double> (*pending_region_position) - _last_frame_position) / _editor->frames_per_unit;
|
dx = (static_cast<double> (*pending_region_position) - _last_frame_position) / _editor->frames_per_unit;
|
||||||
|
|
||||||
/* total x movement */
|
/* 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 */
|
/* check that no regions have gone off the start of the session */
|
||||||
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
|
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;
|
y_delta = rtv->view()->child_height () * pointer_layer_span;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (_brushing) {
|
if (_brushing) {
|
||||||
_editor->mouse_brush_insert_region (rv, pending_region_position);
|
_editor->mouse_brush_insert_region (rv, pending_region_position);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,11 @@ public:
|
||||||
virtual void finished (GdkEvent *, bool) = 0;
|
virtual void finished (GdkEvent *, bool) = 0;
|
||||||
virtual void aborted ();
|
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:
|
protected:
|
||||||
struct TimeAxisViewSummary {
|
struct TimeAxisViewSummary {
|
||||||
TimeAxisViewSummary () : height_list(512) {}
|
TimeAxisViewSummary () : height_list(512) {}
|
||||||
|
|
@ -300,6 +305,10 @@ public:
|
||||||
void finished (GdkEvent *, bool);
|
void finished (GdkEvent *, bool);
|
||||||
void aborted ();
|
void aborted ();
|
||||||
|
|
||||||
|
bool regions_came_from_canvas () const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<nframes64_t, int> move_threshold () const {
|
std::pair<nframes64_t, int> move_threshold () const {
|
||||||
return std::make_pair (4, 4);
|
return std::make_pair (4, 4);
|
||||||
}
|
}
|
||||||
|
|
@ -316,6 +325,10 @@ public:
|
||||||
|
|
||||||
void finished (GdkEvent *, bool);
|
void finished (GdkEvent *, bool);
|
||||||
void aborted ();
|
void aborted ();
|
||||||
|
|
||||||
|
bool regions_came_from_canvas () const {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Region drag in splice mode */
|
/** Region drag in splice mode */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue