13
0

position playhead on button press in rulers, not button release

git-svn-id: svn://localhost/ardour2/trunk@1089 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-11-07 16:36:10 +00:00
parent 5b6524bed4
commit 8018908f39

View File

@ -138,6 +138,34 @@ Editor::ruler_button_press (GdkEventButton* ev)
ruler_grabbed_widget = grab_widget;
}
gint x,y;
Gdk::ModifierType state;
/* need to use the correct x,y, the event lies */
time_canvas_event_box.get_window()->get_pointer (x, y, state);
nframes_t where = leftmost_frame + pixel_to_frame (x);
switch (ev->button) {
case 1:
/* transport playhead */
snap_to (where);
session->request_locate (where);
break;
case 2:
/* edit cursor */
if (snap_type != Editing::SnapToEditCursor) {
snap_to (where);
}
edit_cursor->set_position (where);
edit_cursor_clock.set (where);
break;
default:
break;
}
return TRUE;
}
@ -150,7 +178,6 @@ Editor::ruler_button_release (GdkEventButton* ev)
/* need to use the correct x,y, the event lies */
time_canvas_event_box.get_window()->get_pointer (x, y, state);
ruler_pressed_button = 0;
if (session == 0) {