+ /* keep track of pointer movement */
+ if (tv) {
+ /* the pointer is currently over a time axis view */
+
+ if (_last_pointer_time_axis_view < 0) {
+ /* last motion event was not over a time axis view
+ * or last y-movement out of the dropzone was not valid
+ */
+ int dtz = 0;
+ if (delta_time_axis_view < 0) {
+ /* in the drop zone, moving up */
+
+ /* _pdropzone is the last known pointer y-axis position inside the DZ.
+ * We do not use negative _last_pointer_time_axis_view because
+ * the dropzone is "packed" (the actual track offset is ignored)
+ *
+ * As opposed to the actual number
+ * of elements in the dropzone (_ndropzone)
+ * _pdropzone is not constrained. This is necessary
+ * to allow moving multiple regions with y-distance
+ * into the DZ.
+ *
+ * There can be 0 elements in the dropzone,
+ * even though the drag-pointer is inside the DZ.
+ *
+ * example:
+ * [ Audio-track, Midi-track, Audio-track, DZ ]
+ * move regions from both audio tracks at the same time into the
+ * DZ by grabbing the region in the bottom track.
+ */
+ assert(current_pointer_time_axis_view >= 0);
+ dtz = std::min((int)_pdropzone, (int)_ddropzone - delta_time_axis_view);
+ _pdropzone -= dtz;
+ }
+
+ /* only move out of the zone if the movement is OK */
+ if (_pdropzone == 0 && delta_time_axis_view != 0) {
+ assert(delta_time_axis_view < 0);
+ _last_pointer_time_axis_view = current_pointer_time_axis_view;
+ /* if all logic and maths are correct, there is no need to assign the 'current' pointer.
+ * the current position can be calculated as follows:
+ */
+ // a well placed oofus attack can still throw this off.
+ // likley auto-scroll related, printf() debugging may tell, commented out for now.
+ //assert (current_pointer_time_axis_view == _time_axis_views.size() - dtz + _ddropzone + delta_time_axis_view);
+ }
+ } else {
+ /* last motion event was also over a time axis view */
+ _last_pointer_time_axis_view += delta_time_axis_view;
+ assert(_last_pointer_time_axis_view >= 0);
+ }
+
+ } else {
+
+ /* the pointer is not over a time axis view */
+ assert ((delta_time_axis_view > 0) || (((int)_pdropzone) >= (delta_skip - delta_time_axis_view)));
+ _pdropzone += delta_time_axis_view - delta_skip;
+ _last_pointer_time_axis_view = -1; // <0 : we're in the zone, value does not matter.
+ }
+