13
0

VBAP GUI object-grab & position

This commit is contained in:
Robin Gareus 2014-01-12 00:57:27 +01:00 committed by Paul Davis
parent 97758dcbea
commit cc34174652

View File

@ -595,8 +595,8 @@ Panner2d::on_button_press_event (GdkEventButton *ev)
switch (ev->button) { switch (ev->button) {
case 1: case 1:
case 2: case 2:
x = ev->x - border; x = ev->x - hoffset;
y = ev->y - border; y = ev->y - voffset;
if ((drag_target = find_closest_object (x, y, is_signal)) != 0) { if ((drag_target = find_closest_object (x, y, is_signal)) != 0) {
if (!is_signal) { if (!is_signal) {
@ -671,6 +671,8 @@ Panner2d::handle_motion (gint evx, gint evy, GdkModifierType state)
return false; return false;
} }
evx -= hoffset;
evy -= voffset;
if (state & GDK_BUTTON1_MASK && !(state & GDK_BUTTON2_MASK)) { if (state & GDK_BUTTON1_MASK && !(state & GDK_BUTTON2_MASK)) {
CartesianVector c; CartesianVector c;
@ -687,11 +689,7 @@ Panner2d::handle_motion (gint evx, gint evy, GdkModifierType state)
set<Evoral::Parameter> params = panner_shell->panner()->what_can_be_automated(); set<Evoral::Parameter> params = panner_shell->panner()->what_can_be_automated();
set<Evoral::Parameter>::iterator p = params.find(PanElevationAutomation); set<Evoral::Parameter>::iterator p = params.find(PanElevationAutomation);
double y0 = 4.0; CartesianVector cp (evx, evy, 0.0);
if (height > large_size_threshold) {
y0 = 12.0;
}
CartesianVector cp (evx - 12.0, evy - y0, 0.0);
AngularVector av; AngularVector av;
gtk_to_cart (cp); gtk_to_cart (cp);