mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
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
This commit is contained in:
parent
84184cbf7f
commit
5d285c0d64
2 changed files with 17 additions and 57 deletions
|
|
@ -332,47 +332,22 @@ EditorSummary::on_button_press_event (GdkEventButton* ev)
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
||||||
|
|
||||||
/* modifier-click inside the view rectangle: start a zoom drag */
|
/* modifier-click inside the view rectangle: start a zoom drag */
|
||||||
_zoom_position = NONE;
|
|
||||||
|
double const hx = (xr.first + xr.second) * 0.5;
|
||||||
|
_zoom_left = ev->x < hx;
|
||||||
|
_zoom_dragging = true;
|
||||||
|
_editor->_dragging_playhead = true;
|
||||||
|
|
||||||
double const x1 = xr.first + (xr.second - xr.first) * 0.33;
|
/* In theory, we could support vertical dragging, which logically
|
||||||
double const x2 = xr.first + (xr.second - xr.first) * 0.67;
|
might scale track heights in order to make the editor reflect
|
||||||
double const y1 = yr.first + (yr.second - yr.first) * 0.33;
|
the dragged viewbox. However, having tried this:
|
||||||
double const y2 = yr.first + (yr.second - yr.first) * 0.67;
|
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
|
||||||
|
|
||||||
if (ev->x < x1) {
|
So at the moment we don't support that...
|
||||||
|
*/
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -424,11 +399,9 @@ EditorSummary::on_motion_notify_event (GdkEventMotion* ev)
|
||||||
|
|
||||||
double const dx = ev->x - _start_mouse_x;
|
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;
|
xr.first += dx;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (_zoom_position == TOP_RIGHT || _zoom_position == RIGHT || _zoom_position == BOTTOM_RIGHT) {
|
|
||||||
xr.second += dx;
|
xr.second += dx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,20 +77,7 @@ private:
|
||||||
bool _moved;
|
bool _moved;
|
||||||
|
|
||||||
bool _zoom_dragging;
|
bool _zoom_dragging;
|
||||||
|
bool _zoom_left;
|
||||||
enum ZoomPosition {
|
|
||||||
TOP_LEFT,
|
|
||||||
TOP,
|
|
||||||
TOP_RIGHT,
|
|
||||||
RIGHT,
|
|
||||||
BOTTOM_RIGHT,
|
|
||||||
BOTTOM,
|
|
||||||
BOTTOM_LEFT,
|
|
||||||
LEFT,
|
|
||||||
NONE
|
|
||||||
};
|
|
||||||
|
|
||||||
ZoomPosition _zoom_position;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue