Compare commits

...

1 Commits

2 changed files with 16 additions and 10 deletions

View File

@ -387,14 +387,13 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll)
return false;
}
pair<framecnt_t, int> const threshold = move_threshold ();
pair<double, double> const threshold = move_threshold ();
bool const old_move_threshold_passed = _move_threshold_passed;
if (!_move_threshold_passed) {
bool const xp = (::llabs (_drags->current_pointer_frame () - _raw_grab_frame) >= threshold.first);
bool const yp = (::fabs ((current_pointer_y () - _grab_y)) >= threshold.second);
bool const xp = (fabs(pointer_delta_from_grab_x()) >= threshold.first);
bool const yp = (fabs(pointer_delta_from_grab_y()) >= threshold.second);
_move_threshold_passed = ((xp && x_movement_matters()) || (yp && y_movement_matters()));
}

View File

@ -180,8 +180,9 @@ public:
return true;
}
/** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
/** @return minimum number of pixels (in x) and pixels (in y) that should be
* considered a movement */
virtual std::pair<double, double> move_threshold () const {
return std::make_pair (1, 1);
}
@ -243,6 +244,12 @@ protected:
double current_pointer_x () const;
double current_pointer_y () const;
double pointer_delta_from_grab_x () const
{ return current_pointer_x() - grab_x(); }
double pointer_delta_from_grab_y () const
{ return current_pointer_y() - grab_y(); }
/* sets snap delta from unsnapped pos */
void setup_snap_delta (framepos_t pos);
@ -391,7 +398,7 @@ public:
return true;
}
std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
std::pair<double, double> move_threshold () const {
return std::make_pair (4, 4);
}
@ -918,7 +925,7 @@ public:
void finished (GdkEvent *, bool);
void aborted (bool);
std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
std::pair<double, double> move_threshold () const {
return std::make_pair (8, 1);
}
@ -1076,7 +1083,7 @@ public:
void finished (GdkEvent *, bool);
void aborted (bool);
std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
std::pair<double, double> move_threshold () const {
return std::make_pair (4, 4);
}
@ -1140,7 +1147,7 @@ class CrossfadeEdgeDrag : public Drag
return false;
}
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
virtual std::pair<double, double> move_threshold () const {
return std::make_pair (4, 4);
}