From fe52d8c5df1fee549903bb16c1b24920c12ee4cc Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Sun, 16 Jul 2023 18:26:23 +0800 Subject: [PATCH] draw Transistor --- ses_layout.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/ses_layout.c b/ses_layout.c index c2a3c4f..c528d01 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -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; -- 2.25.1