draw Transistor
authoryu.dongliang <18588496441@163.com>
Sun, 16 Jul 2023 10:26:23 +0000 (18:26 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 16 Jul 2023 10:26:48 +0000 (18:26 +0800)
ses_layout.c

index c2a3c4fc63caaed8b85c1908879c8b88c8f68a5a..c528d017c475e9a82fccc35094377cf80991376b 100644 (file)
@@ -926,37 +926,20 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
                                        cairo_rel_move_to(cr, dx0,  dy0);
                                        cairo_rel_line_to(cr, dx2,  dy2);
 
-                                       if (pc->y < pe->y) {
-                                               cairo_move_to(cr, c->x,  c->y);
-                                               cairo_line_to(cr, c->x + dx3 + dx0,  c->y + dy3 + dy0);
-                                               cairo_line_to(cr, pe->x, pe->y);
+                                       cairo_move_to(cr, c->x,  c->y);
+                                       cairo_line_to(cr, c->x + dx3 + dx0,  c->y + dy3 + dy0);
+                                       cairo_line_to(cr, pe->x, pe->y);
 
-                                               vertical(&dx1, &dy1, dx3 + dx0, dy3 + dy0, 3);
-                                               forward (&dx4, &dy4, dx3 + dx0, dy3 + dy0, 8);
+                                       vertical(&dx1, &dy1, dx3 + dx0, dy3 + dy0, 3);
+                                       forward (&dx4, &dy4, dx3 + dx0, dy3 + dy0, 8);
 
-                                               cairo_move_to(cr, c->x + dx4 + dx1,  c->y + dy4 + dy1);
-                                               cairo_line_to(cr, c->x + dx3 + dx0,  c->y + dy3 + dy0);
-                                               cairo_line_to(cr, c->x + dx4 - dx1,  c->y + dy4 - dy1);
+                                       cairo_move_to(cr, c->x + dx4 + dx1,  c->y + dy4 + dy1);
+                                       cairo_line_to(cr, c->x + dx3 + dx0,  c->y + dy3 + dy0);
+                                       cairo_line_to(cr, c->x + dx4 - dx1,  c->y + dy4 - dy1);
 
-                                               cairo_move_to(cr, c->x,  c->y);
-                                               cairo_line_to(cr, c->x + dx3 - dx0,  c->y + dy3 - dy0);
-                                               cairo_line_to(cr, pc->x, pc->y);
-                                       } else {
-                                               cairo_move_to(cr, c->x,  c->y);
-                                               cairo_line_to(cr, c->x + dx3 + dx0,  c->y + dy3 + dy0);
-                                               cairo_line_to(cr, pc->x, pc->y);
-
-                                               cairo_move_to(cr, c->x,  c->y);
-                                               cairo_line_to(cr, c->x + dx3 - dx0,  c->y + dy3 - dy0);
-                                               cairo_line_to(cr, pe->x, pe->y);
-
-                                               vertical(&dx1, &dy1, dx3 - dx0, dy3 - dy0, 3);
-                                               forward (&dx4, &dy4, dx3 - dx0, dy3 - dy0, 8);
-
-                                               cairo_move_to(cr, c->x + dx4 + dx1,  c->y + dy4 + dy1);
-                                               cairo_line_to(cr, c->x + dx3 - dx0,  c->y + dy3 - dy0);
-                                               cairo_line_to(cr, c->x + dx4 - dx1,  c->y + dy4 - dy1);
-                                       }
+                                       cairo_move_to(cr, c->x,  c->y);
+                                       cairo_line_to(cr, c->x + dx3 - dx0,  c->y + dy3 - dy0);
+                                       cairo_line_to(cr, pc->x, pc->y);
                                        break;
                                default:
                                        break;