[Summary]: correct focus position after using Zoom tool with selection. Previously focus was on the Playhead

This commit is contained in:
YPozdnyakov 2015-02-07 15:30:10 +02:00
parent ae63fea359
commit bda9bc7c35
3 changed files with 11 additions and 0 deletions

View file

@ -307,6 +307,7 @@ Editor::Editor ()
/* nudge */
, nudge_clock (new AudioClock (X_("nudge"), false, X_("nudge"), true, false, true))
, _zoom_tool_was_used (false)
, meters_running(false)
, _pending_locate_request (false)
, _pending_initial_locate (false)

View file

@ -2192,6 +2192,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
PBD::ScopedConnectionList port_state_connection_list;
void update_progress_dialog_of_changing_tracks (bool);
bool _zoom_tool_was_used;
/* members and methods associated with MIDI + markers */

View file

@ -1825,6 +1825,7 @@ Editor::temporal_zoom_by_frame (framepos_t start, framepos_t end)
new_leftmost = 0;
}
_zoom_tool_was_used = true;
reposition_and_zoom (new_leftmost, new_fpp);
}
@ -1876,12 +1877,19 @@ Editor::temporal_zoom_to_frame (bool coarser, framepos_t frame)
new_leftmost = 0;
}
_zoom_tool_was_used = true;
reposition_and_zoom (new_leftmost, new_spp);
}
void
Editor::temporal_zoom_by_slider ()
{
if (_zoom_tool_was_used) {
// tool zoom was used
// we shouldn't call temporal_zoom
_zoom_tool_was_used = false;
return ;
}
double value = _temporal_zoom_adjustment.get_value();
int64_t spp = (int64_t)(pow (2.0f, (int)value) + 0.001);
set_zoom_focus (ZoomFocusPlayhead);