fix window_to_world() issues inside ardour
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 2 Jan 2006 20:27:51 +0000 (20:27 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 2 Jan 2006 20:27:51 +0000 (20:27 +0000)
git-svn-id: svn://localhost/trunk/ardour2@228 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc
gtk2_ardour/editor_canvas.cc
gtk2_ardour/editor_keyboard.cc
gtk2_ardour/editor_mouse.cc
gtk2_ardour/editor_ops.cc

index eb611ab0667854826765cfd35606706dc1679e1e..3036bd55d4f73b23c7310f2689384468a1cb238d 100644 (file)
@@ -537,8 +537,8 @@ Editor::Editor (AudioEngine& eng)
        // GTK2FIX
        // route_list_display.signal_rows_reordered().connect (mem_fun (*this, &Editor::queue_route_list_reordered));
 
-       // GTK2FIX
-       // route_display_model->set_sort_func (0, mem_fun (*this, &Editor::route_list_compare_func));
+       route_display_model->set_sort_func (0, mem_fun (*this, &Editor::route_list_compare_func));
+       route_display_model->set_sort_column (0, SORT_ASCENDING);
 
        route_list_scroller.add (route_list_display);
        route_list_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
index 8b496f170fbeb2461f9b624c3a600b765a57925d..c1762a414917f535251304aae1b92328f7952950 100644 (file)
@@ -441,7 +441,9 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context,
        double wx;
        double wy;
 
-       track_canvas.window_to_world ( x, y, wx, wy);
+       track_canvas.window_to_world (x, y, wx, wy);
+       wx += horizontal_adjustment.get_value();
+       wy += vertical_adjustment.get_value();
        
        ev.type = GDK_BUTTON_RELEASE;
        ev.button.x = wx;
index abc9466af5ced62fdde2b1da73bc2fef8e8f2c18..43935752f005a734c4dc7491fa474b37e5335b0f 100644 (file)
@@ -47,6 +47,8 @@ Editor::kbd_driver (sigc::slot<void,GdkEvent*> theslot, bool use_track_canvas, b
                }
 
                track_canvas.window_to_world (x, y, worldx, worldy);
+               worldx += horizontal_adjustment.get_value();
+               worldy += vertical_adjustment.get_value();
 
                ev.type = GDK_BUTTON_PRESS;
                ev.button.x = worldx;
index 4f93ba65e5b05d36d737ddd93ef79eb45f117903..65f1f7a6cb937c7c25b0c91ec72f32103c9502dc 100644 (file)
@@ -103,7 +103,7 @@ Editor::event_frame (GdkEvent* event, double* pcx, double* pcy)
           position is negative (as can be the case with motion events in particular),
           the frame location is always positive.
        */
-
+       
        return pixel_to_frame (*pcx);
 }
 
@@ -1483,6 +1483,7 @@ Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item
 
        drag_info.current_pointer_frame = event_frame (event, &drag_info.current_pointer_x,
                                                       &drag_info.current_pointer_y);
+
        if (drag_info.item) {
                /* item != 0 is the best test i can think of for 
                   dragging.
index 68baba3061815c8170c29ebe2751fa323a5641c2..aa8eec8df32b9278db679ebbe7da5bb4069e80c2 100644 (file)
@@ -1468,6 +1468,8 @@ Editor::insert_region_list_drag (AudioRegion& region, int x, int y)
        Playlist *playlist;
        
        track_canvas.window_to_world (x, y, wx, wy);
+       wx += horizontal_adjustment.get_value();
+       wy += vertical_adjustment.get_value();
 
        GdkEvent event;
        event.type = GDK_BUTTON_RELEASE;
@@ -3154,8 +3156,12 @@ Editor::mouse_paste ()
 {
        int x, y;
        double wx, wy;
+
        track_canvas.get_pointer (x, y);
        track_canvas.window_to_world (x, y, wx, wy);
+       wx += horizontal_adjustment.get_value();
+       wy += vertical_adjustment.get_value();
+
        GdkEvent event;
        event.type = GDK_BUTTON_RELEASE;
        event.button.x = wx;