fix window_to_world() issues inside ardour

git-svn-id: svn://localhost/trunk/ardour2@228 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-01-02 20:27:51 +00:00
parent feed0fc333
commit 6c4caff156
5 changed files with 15 additions and 4 deletions

View 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);

View 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;

View 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;

View 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.

View 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;