X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fdesigner.cpp;h=3b43efd11ff5226b64cfa0cc9478a72adca90fde;hb=f8a7788cee0261babfc4c804a58515aad6dfbc3d;hp=2002bd987910a7d28893ba32b1efd15db0671e39;hpb=460c64181aca1a134d74cb15ea4ad3bb4f275b60;p=r2c2.git diff --git a/source/designer/designer.cpp b/source/designer/designer.cpp index 2002bd9..3b43efd 100644 --- a/source/designer/designer.cpp +++ b/source/designer/designer.cpp @@ -335,14 +335,14 @@ void Designer::add_selection_to_zone() show_zone(*cur_zone); } -Point Designer::map_pointer_to_ground(int x, int y) +Vector 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; GL::Vector4 vec = camera.unproject(GL::Vector4(xf, yf, 0, 0)); const GL::Vector3 &pos = camera.get_position(); - return Point(pos.x-vec.x*pos.z/vec.z, pos.y-vec.y*pos.z/vec.z); + return Vector(pos.x-vec.x*pos.z/vec.z, pos.y-vec.y*pos.z/vec.z); } void Designer::tick() @@ -462,7 +462,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_to_ground(x, y); + Vector ground = map_pointer_to_ground(x, y); if(mode==CATALOGUE) { @@ -506,7 +506,7 @@ void Designer::pointer_motion(int x, int y) if(!root.get_child_at(x, y)) { - Point ground = map_pointer_to_ground(x, y); + Vector ground = map_pointer_to_ground(x, y); measure.pointer_motion(x, y, ground.x, ground.y); } }