X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fdesigner.cpp;h=51dad8f1a6ee4d42b3bcab4bbae1667952e5953e;hb=9abaa89f495307c7e90cbef51ae0fedbaff001db;hp=c071b5b4612d46d47d331d6545fd07da008e7483;hpb=cd6686b4821de95505ac94115e0966e4ff7cdc57;p=r2c2.git diff --git a/source/designer/designer.cpp b/source/designer/designer.cpp index c071b5b..51dad8f 100644 --- a/source/designer/designer.cpp +++ b/source/designer/designer.cpp @@ -49,7 +49,7 @@ Designer::Designer(int argc, char **argv): base_object(0), cur_route(0), mode(SELECT), - manipulator(*this, selection), + manipulator(*this, root, selection), measure(*this), camera_ctl(*this, root, camera), track_wrap(*this, selection) @@ -248,7 +248,7 @@ void Designer::add_selection_to_route() show_route(cur_route); } -Point Designer::map_pointer_coords(int x, int y) +Point Designer::map_pointer_to_ground(int x, int y) { float xf = x*2.0/window.get_width()-1.0; float yf = y*2.0/window.get_height()-1.0; @@ -379,7 +379,7 @@ void Designer::button_press(int x, int y, unsigned btn, unsigned mod) y = window.get_height()-y-1; mod = Input::mod_from_sys(mod); - Point ground = map_pointer_coords(x, y); + Point ground = map_pointer_to_ground(x, y); if(mode==CATALOGUE) { @@ -413,8 +413,6 @@ void Designer::button_press(int x, int y, unsigned btn, unsigned mod) } } } - else if(mode==MANIPULATE) - manipulator.button_press(x, y, ground.x, ground.y, btn); else if(mode==MEASURE) measure.button_press(x, y, ground.x, ground.y, btn); } @@ -425,8 +423,7 @@ void Designer::pointer_motion(int x, int y) if(!root.get_child_at(x, y)) { - Point ground = map_pointer_coords(x, y); - manipulator.pointer_motion(x, y, ground.x, ground.y); + Point ground = map_pointer_to_ground(x, y); measure.pointer_motion(x, y, ground.x, ground.y); } }