[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Stupid newbie question



DJ Delorie wrote:
One idea is to have the shift or ctrl keys temporarily toggle "snap to
pin" mode.  Draw nets as usual, but just before you select the final
pin, press and hold the shift key to go to snap to pin mode, select
the final pin, then release the shift key to revert to grid (or no
grid) mode.
That's a good idea, DJ. I've been flipping through the code and this doesn't look all that hard if somebody can help me find one thing. It looks like there just needs to be an addition to the snap_grid() function called snap_pin(). It would be called after snap_grid() with exactly the same usage, and only in modules where pin-snapping made sense, like o_net. The function would need to find if there was a pin within ideal snap distance (probably snap_grid/2 or /3, depending on the sensitivity you want) of the current cursor.

So the one piece of help I need is that I don't see an easy way to search objects in a given area. How can I iterate across a set of pins and determine their locations?

Regards,
Chad