Prevent vertical autoscroll when dragging the playhead.
git-svn-id: svn://localhost/ardour2/branches/3.0@5186 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b192de88b6
commit
478bab5380
|
@ -1882,7 +1882,7 @@ public:
|
|||
bool autoscroll_canvas ();
|
||||
void start_canvas_autoscroll (int x, int y);
|
||||
void stop_canvas_autoscroll ();
|
||||
void maybe_autoscroll (GdkEventMotion*);
|
||||
void maybe_autoscroll (GdkEventMotion*, bool);
|
||||
bool allow_vertical_scroll;
|
||||
|
||||
/* trimming */
|
||||
|
|
|
@ -540,7 +540,7 @@ Editor::drop_regions (const RefPtr<Gdk::DragContext>& context,
|
|||
}
|
||||
|
||||
void
|
||||
Editor::maybe_autoscroll (GdkEventMotion* event)
|
||||
Editor::maybe_autoscroll (GdkEventMotion* event, bool allow_vert)
|
||||
{
|
||||
nframes64_t rightmost_frame = leftmost_frame + current_page_frames();
|
||||
nframes64_t frame = _drag->current_pointer_frame();
|
||||
|
@ -548,7 +548,7 @@ Editor::maybe_autoscroll (GdkEventMotion* event)
|
|||
|
||||
autoscroll_y = 0;
|
||||
autoscroll_x = 0;
|
||||
if (event->y < canvas_timebars_vsize) {
|
||||
if (event->y < canvas_timebars_vsize && allow_vert) {
|
||||
autoscroll_y = -1;
|
||||
startit = true;
|
||||
} else if (event->y > _canvas_height) {
|
||||
|
|
|
@ -207,7 +207,7 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll)
|
|||
|
||||
if (event->motion.state & Gdk::BUTTON1_MASK || event->motion.state & Gdk::BUTTON2_MASK) {
|
||||
if (!from_autoscroll) {
|
||||
_editor->maybe_autoscroll (&event->motion);
|
||||
_editor->maybe_autoscroll (&event->motion, allow_vertical_autoscroll ());
|
||||
}
|
||||
|
||||
motion (event, _had_movement != old_had_movement);
|
||||
|
|
|
@ -110,6 +110,10 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual bool allow_vertical_autoscroll () const {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Called when a subclass should update the editor's selection following a drag */
|
||||
virtual void update_selection () {}
|
||||
|
||||
|
@ -343,6 +347,10 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
bool allow_vertical_autoscroll () const {
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
EditorCursor* _cursor; ///< cursor being dragged
|
||||
bool _stop; ///< true to stop the transport on starting the drag, otherwise false
|
||||
|
|
Loading…
Reference in New Issue