Merge with 2.0-ongoing R2988
[ardour.git] / gtk2_ardour / editor_mouse.cc
index 06f0243805adcf558e2e6229ac5139e05d824db5..4234368acdc6c67a992097039fd2152f8d3cd379 100644 (file)
@@ -3382,7 +3382,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                        }
            
                        if (sync_frame - sync_offset <= sync_frame) {
-                               pending_region_position = sync_frame + (sync_dir*sync_offset);
+                               pending_region_position = sync_frame - (sync_dir*sync_offset);
                        } else {
                                pending_region_position = 0;
                        }
@@ -5331,11 +5331,15 @@ Editor::end_time_fx (ArdourCanvas::Item* item, GdkEvent* event)
        }
        
        nframes_t newlen = drag_info.last_pointer_frame - clicked_regionview->region()->position();
-#ifdef USE_RUBBERBAND
-       float percentage = (float) ((double) newlen / (double) clicked_regionview->region()->length());
-#else
-       float percentage = (float) ((double) newlen - (double) clicked_regionview->region()->length()) / ((double) newlen) * 100.0f;
+
+       float percentage = (double) newlen / (double) clicked_regionview->region()->length();
+
+#ifndef USE_RUBBERBAND
+       // Soundtouch uses percentage / 100 instead of normal (/ 1) 
+       if (clicked_regionview->region()->data_type() == DataType::AUDIO) {
+               percentage = (float) ((double) newlen - (double) clicked_regionview->region()->length()) / ((double) newlen) * 100.0f;
 #endif 
+       }
 
        begin_reversible_command (_("timestretch"));