diff options
author | Carl Hetherington <carl@carlh.net> | 2009-06-17 00:16:52 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-06-17 00:16:52 +0000 |
commit | 5d285c0d645a2253aa398410e430dd78dd8e971b (patch) | |
tree | 4b5f0d484139522229d76985277dd75b89b07491 /gtk2_ardour | |
parent | 84184cbf7f5651895ec9812e4b20beb9d7fa546f (diff) |
Remove partial support for vertical zoom in the summary, basically because it's quite hard. See comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@5204 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_summary.cc | 63 | ||||
-rw-r--r-- | gtk2_ardour/editor_summary.h | 15 |
2 files changed, 19 insertions, 59 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index d1f5821ce5..1b6441a092 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -332,47 +332,22 @@ EditorSummary::on_button_press_event (GdkEventButton* ev) if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { /* modifier-click inside the view rectangle: start a zoom drag */ - _zoom_position = NONE; - - double const x1 = xr.first + (xr.second - xr.first) * 0.33; - double const x2 = xr.first + (xr.second - xr.first) * 0.67; - double const y1 = yr.first + (yr.second - yr.first) * 0.33; - double const y2 = yr.first + (yr.second - yr.first) * 0.67; - - if (ev->x < x1) { - - if (ev->y < y1) { - _zoom_position = TOP_LEFT; - } else if (ev->y > y2) { - _zoom_position = BOTTOM_LEFT; - } else { - _zoom_position = LEFT; - } - - } else if (ev->x > x2) { - - if (ev->y < y1) { - _zoom_position = TOP_RIGHT; - } else if (ev->y > y2) { - _zoom_position = BOTTOM_RIGHT; - } else { - _zoom_position = RIGHT; - } - - } else { - - if (ev->y < y1) { - _zoom_position = TOP; - } else if (ev->y > y2) { - _zoom_position = BOTTOM; - } - - } - - if (_zoom_position != NONE) { - _zoom_dragging = true; - _editor->_dragging_playhead = true; - } + + double const hx = (xr.first + xr.second) * 0.5; + _zoom_left = ev->x < hx; + _zoom_dragging = true; + _editor->_dragging_playhead = true; + + /* In theory, we could support vertical dragging, which logically + might scale track heights in order to make the editor reflect + the dragged viewbox. However, having tried this: + a) it's hard to do + b) it's quite slow + c) it doesn't seem particularly useful, especially with the + limited height of the summary + + So at the moment we don't support that... + */ } else { @@ -424,11 +399,9 @@ EditorSummary::on_motion_notify_event (GdkEventMotion* ev) double const dx = ev->x - _start_mouse_x; - if (_zoom_position == TOP_LEFT || _zoom_position == LEFT || _zoom_position == BOTTOM_LEFT) { + if (_zoom_left) { xr.first += dx; - } - - if (_zoom_position == TOP_RIGHT || _zoom_position == RIGHT || _zoom_position == BOTTOM_RIGHT) { + } else { xr.second += dx; } diff --git a/gtk2_ardour/editor_summary.h b/gtk2_ardour/editor_summary.h index 817940796f..bbff050117 100644 --- a/gtk2_ardour/editor_summary.h +++ b/gtk2_ardour/editor_summary.h @@ -77,20 +77,7 @@ private: bool _moved; bool _zoom_dragging; - - enum ZoomPosition { - TOP_LEFT, - TOP, - TOP_RIGHT, - RIGHT, - BOTTOM_RIGHT, - BOTTOM, - BOTTOM_LEFT, - LEFT, - NONE - }; - - ZoomPosition _zoom_position; + bool _zoom_left; }; #endif |