SebLague / Digital-Logic-Sim

https://sebastian.itch.io/digital-logic-sim
Other
3.55k stars 432 forks source link

Add snap to grid #132

Open joranmulderij opened 1 year ago

joranmulderij commented 1 year ago

Hi, could you add the option to let components and wires snap to a grid. I don't think there are many drawbacks to doing this. It would make the program more fun to use.

Love your series BTW ❤️

dancojocaru2000 commented 1 year ago

Wires snap to grid if you hold Shift. It seems components can't be snapped for now.

y2k04 commented 1 year ago

Would love to have a snap to grid option for the circuit chips themselves

SebLague commented 1 year ago

Definitely want to add this. The one thing I'm uncertain of though is how the pins on the chips should line up with the grid to allow wire snapping to work. For example if a chip has 4 inputs and 3 outputs, the input pins would line up with the grid, but the output pins would not (unless I spaced them strangely, or added a 4th 'dead' pin to make it work). Would be interested to hear any thoughts on this!

Wilson159 commented 1 year ago

Definitely want to add this. The one thing I'm uncertain of though is how the pins on the chips should line up with the grid to allow wire snapping to work. For example if a chip has 4 inputs and 3 outputs, the input pins would line up with the grid, but the output pins would not (unless I spaced them strangely, or added a 4th 'dead' pin to make it work). Would be interested to hear any thoughts on this!

Could you add a few different snapping "nodes", one to each corner and then one on the center point of each side as well as one in the middle of the chip? This would allow the user to snap it however they wanted to but also allow for odd numbered chips.

Vanny-Chuck commented 12 months ago

Perhaps take it the way that Turing Complete took it with its component factory (Its Great wip Game! missing clk mem tho)