Increase threshold for zoom-by-horizontal movement;

ignore movements to y positions outside the scroomer;
round page size and value to prevent 'quivering' during
drags.  Should fix #4299.


git-svn-id: svn://localhost/ardour2/branches/3.0@10063 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-09-07 14:11:33 +00:00
parent 3ba6804f27
commit bb91aaa5ec

View file

@ -74,6 +74,10 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
return true; return true;
} }
if (ev->y < 0 || ev->y > get_height ()) {
return true;
}
grab_y = ev->y; grab_y = ev->y;
if (ev->state & Keyboard::PrimaryModifier) { if (ev->state & Keyboard::PrimaryModifier) {
@ -138,10 +142,11 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
/* Then we handle zoom, which is dragging horizontally. We zoom around the area that is /* Then we handle zoom, which is dragging horizontally. We zoom around the area that is
* the current y pointer value, not from the area that was the start of the drag. * the current y pointer value, not from the area that was the start of the drag.
* the point of zoom must have the same * We don't start doing zoom until we are at least one scroomer width outside the scroomer's
* area.
*/ */
if (ev->x > get_width()) { if (ev->x > (get_width() * 2)) {
zoom = ev->x - get_width(); zoom = ev->x - get_width();
double higher = unzoomed_val + unzoomed_page - half_min_page - val_at_pointer; double higher = unzoomed_val + unzoomed_page - half_min_page - val_at_pointer;
@ -195,8 +200,9 @@ Scroomer::on_motion_notify_event (GdkEventMotion* ev)
page = unzoomed_page; page = unzoomed_page;
} }
adj.set_page_size(page); /* Round these values to stop the scroomer handlers quivering about during drags */
adj.set_value(val); adj.set_page_size (rint (page));
adj.set_value (rint (val));
adj.value_changed(); adj.value_changed();
return true; return true;