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:
Carl Hetherington 2009-06-14 13:32:17 +00:00
parent b192de88b6
commit 478bab5380
4 changed files with 12 additions and 4 deletions

View File

@ -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 */

View File

@ -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) {

View File

@ -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);

View File

@ -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