summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorSampo Savolainen <v2@iki.fi>2006-08-23 18:29:22 +0000
committerSampo Savolainen <v2@iki.fi>2006-08-23 18:29:22 +0000
commitba09117dfa6c46a52c3536e43c8022f9cf6107a6 (patch)
treef1e959b9e81ccda4edc524bca8e8ecb5db8d0071 /gtk2_ardour
parent4273f948130e831677549bf2c0546487a061908f (diff)
Make canvas autoscroll work properly.
git-svn-id: svn://localhost/ardour2/trunk@845 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_rulers.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc
index 47641655e7..86bd19b9bf 100644
--- a/gtk2_ardour/editor_rulers.cc
+++ b/gtk2_ardour/editor_rulers.cc
@@ -215,7 +215,7 @@ Editor::ruler_mouse_motion (GdkEventMotion* ev)
if (session == 0 || !ruler_pressed_button) {
return FALSE;
}
-
+
double wcx=0,wcy=0;
double cx=0,cy=0;
@@ -231,24 +231,23 @@ Editor::ruler_mouse_motion (GdkEventMotion* ev)
jack_nframes_t where = leftmost_frame + pixel_to_frame (x);
- /// ripped from maybe_autoscroll
+
+ /// ripped from maybe_autoscroll, and adapted to work here
jack_nframes_t one_page = (jack_nframes_t) rint (canvas_width * frames_per_unit);
jack_nframes_t rightmost_frame = leftmost_frame + one_page;
- jack_nframes_t frame = pixel_to_frame (cx);
-
if (autoscroll_timeout_tag < 0) {
- if (frame > rightmost_frame) {
+ if (where > rightmost_frame) {
if (rightmost_frame < max_frames) {
- start_canvas_autoscroll (1);
+ start_canvas_autoscroll (10);
}
- } else if (frame < leftmost_frame) {
+ } else if (where <= leftmost_frame) {
if (leftmost_frame > 0) {
start_canvas_autoscroll (-1);
}
}
} else {
- if (frame >= leftmost_frame && frame < rightmost_frame) {
+ if (where >= leftmost_frame && where < rightmost_frame) {
stop_canvas_autoscroll ();
}
}