summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_canvas.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-06-29 19:08:19 +0000
committerCarl Hetherington <carl@carlh.net>2010-06-29 19:08:19 +0000
commit7898aabcaa08659cd0bee5bba61df4503b7fadc7 (patch)
tree57cfb8e9693f527595bd5a9045e60f3c9d8c7573 /gtk2_ardour/editor_canvas.cc
parentbebeb5abec36919ac4fce9602a2ad94a4d79935a (diff)
Fix vertical canvas autoscroll when dragging track heights. Fixes #3240.
git-svn-id: svn://localhost/ardour2/branches/3.0@7327 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r--gtk2_ardour/editor_canvas.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 212da05c0c..7b13f66584 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -546,37 +546,35 @@ Editor::drop_regions (const RefPtr<Gdk::DragContext>& /*context*/,
}
void
-Editor::maybe_autoscroll (GdkEventMotion* event, bool allow_vert)
+Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert)
{
nframes64_t rightmost_frame = leftmost_frame + current_page_frames();
bool startit = false;
+ double ty = _drags->current_pointer_y() - get_trackview_group_vertical_offset ();
+
autoscroll_y = 0;
autoscroll_x = 0;
- if (event->y < canvas_timebars_vsize && allow_vert) {
+ if (ty < canvas_timebars_vsize && allow_vert) {
autoscroll_y = -1;
startit = true;
- } else if (event->y > _canvas_height) {
+ } else if (ty > _canvas_height && allow_vert) {
autoscroll_y = 1;
startit = true;
}
- if (_drags->current_pointer_frame() > rightmost_frame) {
+ if (_drags->current_pointer_frame() > rightmost_frame && allow_horiz) {
if (rightmost_frame < max_frames) {
autoscroll_x = 1;
startit = true;
}
- } else if (_drags->current_pointer_frame() < leftmost_frame) {
+ } else if (_drags->current_pointer_frame() < leftmost_frame && allow_horiz) {
if (leftmost_frame > 0) {
autoscroll_x = -1;
startit = true;
}
}
- if (!allow_vertical_scroll) {
- autoscroll_y = 0;
- }
-
if ((autoscroll_x != last_autoscroll_x) || (autoscroll_y != last_autoscroll_y) || (autoscroll_x == 0 && autoscroll_y == 0)) {
stop_canvas_autoscroll ();
}
@@ -739,7 +737,6 @@ Editor::start_canvas_autoscroll (int dx, int dy)
void
Editor::stop_canvas_autoscroll ()
{
-
if (autoscroll_timeout_tag >= 0) {
g_source_remove (autoscroll_timeout_tag);
autoscroll_timeout_tag = -1;