From: Lukáš Jiřiště Date: Sat, 29 Mar 2025 17:43:21 +0000 (+0100) Subject: Set the minimum space between FETs to 2 X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=ae9c0eed9d3029ea5bbbd0aa8afebc9912d9eec6;p=FET_sim.git Set the minimum space between FETs to 2 This is much better, because before one could place a FET so that it overlaps a part of another one... --- diff --git a/src/schema_mode.c b/src/schema_mode.c index f4c9a3e..644b25c 100644 --- a/src/schema_mode.c +++ b/src/schema_mode.c @@ -110,7 +110,7 @@ void schema_add_mosfet(WINDOW *schematics_win, t_vec *nodes, t_vec *mosfets, t_p mosfet = ft_vec_access(mosfets, i); rel_pos.x = mosfet->position.x - pos.x; rel_pos.y = mosfet->position.y - pos.y; - if ((-1 <= rel_pos.x && rel_pos.x <= 1) && (-1 <= rel_pos.y && rel_pos.y <= 1)) + if ((-2 <= rel_pos.x && rel_pos.x <= 2) && (-2 <= rel_pos.y && rel_pos.y <= 2)) { // Error - mosfets cannot overlap return ;