Refactor code into Editor::temporal_zoom_step_mouse_focus method
This commit is contained in:
parent
72bdfc38a8
commit
6ba6cce799
|
@ -295,6 +295,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
framecnt_t get_current_zoom () const { return samples_per_pixel; }
|
||||
void cycle_zoom_focus ();
|
||||
void temporal_zoom_step (bool coarser);
|
||||
void temporal_zoom_step_mouse_focus (bool coarser);
|
||||
void ensure_time_axis_view_is_visible (TimeAxisView const & tav, bool at_top);
|
||||
void tav_zoom_step (bool coarser);
|
||||
void tav_zoom_smooth (bool coarser, bool force_all);
|
||||
|
|
|
@ -76,10 +76,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
|||
case GDK_SCROLL_UP:
|
||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
|
||||
//for mouse-wheel zoom, force zoom-focus to mouse
|
||||
Editing::ZoomFocus temp_focus = zoom_focus;
|
||||
zoom_focus = Editing::ZoomFocusMouse;
|
||||
temporal_zoom_step (false);
|
||||
zoom_focus = temp_focus;
|
||||
temporal_zoom_step_mouse_focus (false);
|
||||
return true;
|
||||
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
|
||||
scroll_left_step ();
|
||||
|
@ -105,10 +102,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
|||
case GDK_SCROLL_DOWN:
|
||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
|
||||
//for mouse-wheel zoom, force zoom-focus to mouse
|
||||
Editing::ZoomFocus temp_focus = zoom_focus;
|
||||
zoom_focus = Editing::ZoomFocusMouse;
|
||||
temporal_zoom_step (true);
|
||||
zoom_focus = temp_focus;
|
||||
temporal_zoom_step_mouse_focus (true);
|
||||
return true;
|
||||
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
|
||||
scroll_right_step ();
|
||||
|
@ -1033,10 +1027,7 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType
|
|||
scroll_left_half_page ();
|
||||
} else if (Profile->get_mixbus()) {
|
||||
//for mouse-wheel zoom, force zoom-focus to mouse
|
||||
Editing::ZoomFocus temp_focus = zoom_focus;
|
||||
zoom_focus = Editing::ZoomFocusMouse;
|
||||
temporal_zoom_step (false);
|
||||
zoom_focus = temp_focus;
|
||||
temporal_zoom_step_mouse_focus (false);
|
||||
} else {
|
||||
temporal_zoom_step (false);
|
||||
}
|
||||
|
@ -1049,10 +1040,7 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType
|
|||
scroll_right_half_page ();
|
||||
} else if (Profile->get_mixbus()) {
|
||||
//for mouse-wheel zoom, force zoom-focus to mouse
|
||||
Editing::ZoomFocus temp_focus = zoom_focus;
|
||||
zoom_focus = Editing::ZoomFocusMouse;
|
||||
temporal_zoom_step (true);
|
||||
zoom_focus = temp_focus;
|
||||
temporal_zoom_step_mouse_focus (true);
|
||||
} else {
|
||||
temporal_zoom_step (true);
|
||||
}
|
||||
|
|
|
@ -1687,6 +1687,14 @@ Editor::tav_zoom_smooth (bool coarser, bool force_all)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::temporal_zoom_step_mouse_focus (bool coarser)
|
||||
{
|
||||
Editing::ZoomFocus temp_focus = zoom_focus;
|
||||
zoom_focus = Editing::ZoomFocusMouse;
|
||||
temporal_zoom_step (coarser);
|
||||
zoom_focus = temp_focus;
|
||||
}
|
||||
|
||||
void
|
||||
Editor::temporal_zoom_step (bool coarser)
|
||||
|
|
Loading…
Reference in New Issue