mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
Back to real-time zoom.
git-svn-id: svn://localhost/ardour2/branches/3.0@7278 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
9c4f5ac000
commit
5e12dc768d
2 changed files with 6 additions and 19 deletions
|
|
@ -95,13 +95,7 @@ EditorSummary::on_expose_event (GdkEventExpose* event)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (_editor->pending_visual_change.idle_handler_id < 0) {
|
if (_editor->pending_visual_change.idle_handler_id < 0) {
|
||||||
|
get_editor (&_view_rectangle_x, &_view_rectangle_y);
|
||||||
if (_zoom_dragging) {
|
|
||||||
_view_rectangle_x = _pending_zoom_x;
|
|
||||||
_view_rectangle_y = _pending_zoom_y;
|
|
||||||
} else {
|
|
||||||
get_editor (&_view_rectangle_x, &_view_rectangle_y);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cairo_move_to (cr, _view_rectangle_x.first, _view_rectangle_y.first);
|
cairo_move_to (cr, _view_rectangle_x.first, _view_rectangle_y.first);
|
||||||
|
|
@ -324,8 +318,6 @@ EditorSummary::on_button_press_event (GdkEventButton* ev)
|
||||||
_zoom_position = get_position (ev->x, ev->y);
|
_zoom_position = get_position (ev->x, ev->y);
|
||||||
_zoom_dragging = true;
|
_zoom_dragging = true;
|
||||||
_editor->_dragging_playhead = true;
|
_editor->_dragging_playhead = true;
|
||||||
_pending_zoom_x = xr;
|
|
||||||
_pending_zoom_y = yr;
|
|
||||||
|
|
||||||
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
|
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
|
||||||
|
|
||||||
|
|
@ -484,19 +476,20 @@ EditorSummary::on_motion_notify_event (GdkEventMotion* ev)
|
||||||
double const dy = ev->y - _start_mouse_y;
|
double const dy = ev->y - _start_mouse_y;
|
||||||
|
|
||||||
if (_zoom_position == LEFT || _zoom_position == LEFT_TOP || _zoom_position == LEFT_BOTTOM) {
|
if (_zoom_position == LEFT || _zoom_position == LEFT_TOP || _zoom_position == LEFT_BOTTOM) {
|
||||||
_pending_zoom_x.first = _start_editor_x.first + dx;
|
xr.first += dx;
|
||||||
} else if (_zoom_position == RIGHT || _zoom_position == RIGHT_TOP || _zoom_position == RIGHT_BOTTOM) {
|
} else if (_zoom_position == RIGHT || _zoom_position == RIGHT_TOP || _zoom_position == RIGHT_BOTTOM) {
|
||||||
_pending_zoom_x.second = _start_editor_x.second + dx;
|
xr.second += dx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_zoom_position == TOP || _zoom_position == LEFT_TOP || _zoom_position == RIGHT_TOP) {
|
if (_zoom_position == TOP || _zoom_position == LEFT_TOP || _zoom_position == RIGHT_TOP) {
|
||||||
_pending_zoom_y.first = _start_editor_y.first + dy;
|
yr.first += dy;
|
||||||
} else if (_zoom_position == BOTTOM || _zoom_position == LEFT_BOTTOM || _zoom_position == RIGHT_BOTTOM) {
|
} else if (_zoom_position == BOTTOM || _zoom_position == LEFT_BOTTOM || _zoom_position == RIGHT_BOTTOM) {
|
||||||
_pending_zoom_y.second = _start_editor_y.second + dy;
|
yr.second += dy;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_overlays_dirty ();
|
set_overlays_dirty ();
|
||||||
set_cursor (_zoom_position);
|
set_cursor (_zoom_position);
|
||||||
|
set_editor (xr, yr);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -510,10 +503,6 @@ EditorSummary::on_motion_notify_event (GdkEventMotion* ev)
|
||||||
bool
|
bool
|
||||||
EditorSummary::on_button_release_event (GdkEventButton*)
|
EditorSummary::on_button_release_event (GdkEventButton*)
|
||||||
{
|
{
|
||||||
if (_zoom_dragging) {
|
|
||||||
set_editor (_pending_zoom_x, _pending_zoom_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
_move_dragging = false;
|
_move_dragging = false;
|
||||||
_zoom_dragging = false;
|
_zoom_dragging = false;
|
||||||
_editor->_dragging_playhead = false;
|
_editor->_dragging_playhead = false;
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,6 @@ private:
|
||||||
|
|
||||||
bool _zoom_dragging;
|
bool _zoom_dragging;
|
||||||
Position _zoom_position;
|
Position _zoom_position;
|
||||||
std::pair<double, double> _pending_zoom_x;
|
|
||||||
std::pair<double, double> _pending_zoom_y;
|
|
||||||
|
|
||||||
PBD::ScopedConnectionList position_connection;
|
PBD::ScopedConnectionList position_connection;
|
||||||
PBD::ScopedConnectionList region_property_connection;
|
PBD::ScopedConnectionList region_property_connection;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue