pfalstad / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
1.64k stars 279 forks source link

Tristate buffers can be sized such that it is impossible to connect their middle terminal #92

Open TechnoFairyGirl opened 1 month ago

TechnoFairyGirl commented 1 month ago

Observed behavior:

When inserting / resizing a tristate buffer, it is possible to give it a size that places the middle control terminal halfway between grid points, making it impossible to connect the middle terminal. If the buffer is sized using the default grid size, and then "small grid" is enabled, the middle pin of buffer becomes accessible. However, with "small grid" enabled, it is then possible to resize the buffer such that the middle pin becomes inaccessible even with the smaller grid size.

Expected behavior:

The resize routine for the tristate buffer only allows sizes that place all pins at accessible locations for the user's currently-selected grid size. This could be achieved by snapping the width of the buffer to every other grid point instead of every grid point.

Examples:

Default grid size

image

Small grid size

image