for (m = 0; m + 3 < el0->n_pins; m += 2) {
c0 = f->components[el0->pins[m]];
+ p0 = c0->pins [el0->pins[m + 1]];
- if (2 != c0->n_pins)
- continue;
+ for (j = 0; j < c0->n_pins; j++) {
+ p1 = c0->pins[j];
- p0 = c0->pins[ el0->pins[m + 1]];
- p1 = c0->pins[!el0->pins[m + 1]];
+ if (p1 == p0)
+ continue;
- for (n = 2; n + 1 < el0->n_pins; n += 2) {
+ for (n = 2; n + 1 < el0->n_pins; n += 2) {
- c1 = f->components[el0->pins[n]];
- if (2 != c1->n_pins)
- continue;
+ c1 = f->components[el0->pins[n]];
+ p2 = c1->pins [el0->pins[n + 1]];
- p2 = c1->pins[ el0->pins[n + 1]];
- p3 = c1->pins[!el0->pins[n + 1]];
+ for (k = 0; k < c1->n_pins; k++) {
+ p3 = c1->pins[k];
- if (p1->y < p0->y && p3->y < p0->y) {
+ if (p3 == p2)
+ continue;
- if (p0->x > p2->x) {
+ if (p1->y < p0->y && p3->y < p0->y) {
- if (p1->x < p3->x || p1->y > p3->y)
- SCF_XCHG(p0->x, p2->x);
+ if (p0->x > p2->x) {
- } else {
- if (p1->x > p3->x || p1->y < p3->y)
- SCF_XCHG(p0->x, p2->x);
- }
+ if (p1->x < p3->x || p1->y > p3->y)
+ SCF_XCHG(p0->x, p2->x);
- } else if (p1->y > p0->y && p3->y > p0->y) {
+ } else {
+ if (p1->x > p3->x || p1->y < p3->y)
+ SCF_XCHG(p0->x, p2->x);
+ }
- if (p0->x > p2->x) {
- if (p1->x < p3->x || p1->y < p3->y)
- SCF_XCHG(p0->x, p2->x);
- } else {
- if (p1->x > p3->x || p1->y > p3->y)
- SCF_XCHG(p0->x, p2->x);
+ } else if (p1->y > p0->y && p3->y > p0->y) {
+
+ if (p0->x > p2->x) {
+ if (p1->x < p3->x || p1->y < p3->y)
+ SCF_XCHG(p0->x, p2->x);
+ } else {
+ if (p1->x > p3->x || p1->y > p3->y)
+ SCF_XCHG(p0->x, p2->x);
+ }
+ }
}
}
}