Hi there, On Dienstag, 1. April 2008, Werner Hoch wrote: > the magnetic net mode uncovered some integer arithmetic errors > whenever the coordinates are changed between screen and world (e.g. > with the fix_x() function). > http://sourceforge.net/tracker/index.php?func=detail&aid=1928544&grou >p_id=161080&atid=818426 > > Thus I'd like to change the screen related variables from the screen > coordinates to the world coordinates. > > The affected variables are start_x, second_x, last_x, loc_x and maybe > some more. > > To do this I'd change this with the following steps: > > 1. create a set of world variables in GSCHEM_TOPLEVEL: > start_x --> first_wx > last_x --> second_wx > second_x --> third_wx > The renaming is intentional, because the second_x causes confusions > in the net code whenever I read it. > > 2. add world coordinates to all screen events (mouse move, ...) > SCREENtoWORLD(toplevel, x,y, &wx, &wy); > wx = snap_grid(toplevel, wx); > wy = snap_grid(toplevel, wy); > > 3. subsequently switch each drawing mode (net, line, box, ...) to use > the world coordinates. > (the coordinates are only converted back to screen inside drawing > functions) > > 4. remove the old variables: > start_x, last_x, ... > > 5. remove fix_x, fix_y functions from libgeda.
I've done the changes mentioned above. The complete branch is at http://repo.or.cz/w/geda-gaf/werner.git?a=shortlog;h=refs/heads/world_coordinates Please play a little bit with it. This branch also contains * the net_routing feature * a CTRL modifier for magnetic net * snapping to offgrid pins/nets with printing a warning when doing so I will do some more testing next week. It would be nice if someone else could do some testing to. I'd like to merge those changes in 3 steps to the official repo maybe next weekend. 1. net routing code (branch name: netrouting1) 2. magnetic net mode (branch name: world_netcoordinates) 3. all the rest (branch name: world_coordinates) Regards Werner _______________________________________________ geda-dev mailing list [email protected] http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev
