ScfEfunction* f;
ScfEline* el;
ScfEpin* p;
+ ScfEpin* pb;
+ ScfEpin* pc;
+ ScfEpin* pe;
ScfLine* l;
cairo_surface_t* surface;
break;
case SCF_EDA_Transistor:
- cairo_arc(cr, c->x, c->y, 5, 0, 2 * M_PI);
+ pb = c->pins[SCF_EDA_Transistor_B];
+ pc = c->pins[SCF_EDA_Transistor_C];
+ pe = c->pins[SCF_EDA_Transistor_E];
- p = c->pins[SCF_EDA_Transistor_E];
- cairo_move_to(cr, c->x, c->y);
- cairo_line_to(cr, p->x, p->y);
+ vertical(&dx0, &dy0, c->x - pb->x, c->y - pb->y, 8);
+ vertical(&dx2, &dy2, c->x - pb->x, c->y - pb->y, -16);
+ forward (&dx3, &dy3, c->x - pb->x, c->y - pb->y, 16);
- p = c->pins[SCF_EDA_Transistor_C];
- cairo_move_to(cr, c->x, c->y);
- cairo_line_to(cr, p->x, p->y);
+ cairo_arc(cr, c->x + dx3 / 4, c->y + dy3 / 4, 12, 0, 2 * M_PI);
- p = c->pins[SCF_EDA_Transistor_B];
- cairo_move_to(cr, c->x, c->y);
- cairo_line_to(cr, p->x, p->y);
+ cairo_move_to (cr, pb->x, pb->y);
+ cairo_line_to (cr, c->x, c->y);
+ 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);
+
+ 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);
+ } 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);
+ }
+ break;
default:
break;
};