case SCF_EDA_Resistor:
p = c->pins[0];
- vertical(&dx0, &dy0, c->x - p->x, c->y - p->y, 4);
- vertical(&dx1, &dy1, c->x - p->x, c->y - p->y, -8);
- vertical(&dx2, &dy2, c->x - p->x, c->y - p->y, 8);
+ vertical(&dx0, &dy0, c->x - p->x, c->y - p->y, 3);
+ vertical(&dx1, &dy1, c->x - p->x, c->y - p->y, -6);
+ vertical(&dx2, &dy2, c->x - p->x, c->y - p->y, 6);
- forward (&dx3, &dy3, c->x - p->x, c->y - p->y, -16);
- forward (&dx4, &dy4, c->x - p->x, c->y - p->y, 16);
+ forward (&dx3, &dy3, c->x - p->x, c->y - p->y, -12);
+ forward (&dx4, &dy4, c->x - p->x, c->y - p->y, 12);
scf_logw("dx0: %d, dy0: %d\n", dx0, dy0);
scf_logw("dx1: %d, dy1: %d\n", dx1, dy1);
cairo_rel_line_to(cr, dx2, dy2);
cairo_rel_line_to(cr, dx3, dy3);
- cairo_move_to(cr, c->x, c->y);
- cairo_line_to(cr, p->x, p->y);
+ if (p->y < c->y) {
+ cairo_move_to(cr, c->x, c->y);
+ cairo_line_to(cr, p->x, p->y);
+
+ p = c->pins[1];
+ cairo_move_to(cr, c->x, c->y);
+ cairo_rel_move_to(cr, dx4, dy4);
+ cairo_line_to(cr, p->x, p->y);
+ } else {
+ cairo_move_to(cr, c->x, c->y);
+ cairo_rel_move_to(cr, dx4, dy4);
+ cairo_line_to(cr, p->x, p->y);
+
+ p = c->pins[1];
+ cairo_move_to(cr, c->x, c->y);
+ cairo_line_to(cr, p->x, p->y);
+ }
- p = c->pins[1];
- cairo_move_to(cr, c->x, c->y);
- cairo_line_to(cr, p->x, p->y);
break;
case SCF_EDA_Diode: