if (!l0)
return -ENOMEM;
- l0->x0 = d;
+ l0->x0 = 0;
l0->x1 = d;
l0->y0 = d + i * d;
l0->y1 = l0->y0;
}
}
+ qsort(f->elines, f->n_elines, sizeof(ScfEline*), eline_cmp_id);
+
int mx = 0;
for (i = 0; i < f->n_components - 1; i++) {
} else if (y2 < y0 && y0 < y3 && y3 < y1) {
+ el0 = f->elines[p2->lid];
+ el1 = f->elines[p3->lid];
+
if (p2->x > 0) {
p2->x = -p2->x;
if (mx > p2->x)
}
}
- qsort(f->elines, f->n_elines, sizeof(ScfEline*), eline_cmp_id);
-
for (i = 0; i < f->n_components; i++) {
c0 = f->components[i];
- uint32_t cx = 0;
- uint32_t cy = 0;
+ int cx = 0;
+ int cy = 0;
for (j = 0; j < c0->n_pins; j++) {
p0 = c0->pins[j];
p0->x -= mx - d;
- el0 = f->elines[p0->lid];
-
- if (el0->lines[0]->x1 < p0->x)
- el0->lines[0]->x1 = p0->x;
-
- if (c0->id == 11)
- scf_loge("p0->x: %d, p0->lid: %ld, el0->id: %ld, el0->x1: %d\n", p0->x, p0->lid, el0->id, el0->lines[0]->x1);
-
cx += p0->x;
cy += p0->y;
}
c0->y = cy / c0->n_pins;
}
+ for (i = 0; i < f->n_elines; i++) {
+ el0 = f->elines[i];
+
+ int x0 = INT_MAX;
+ int x1 = 0;
+
+ for (j = 0; j < el0->n_pins; j += 2) {
+
+ c0 = f ->components[el0->pins[j]];
+ p0 = c0->pins [el0->pins[j + 1]];
+
+ if (x0 > p0->x)
+ x0 = p0->x;
+
+ if (x1 < p0->x)
+ x1 = p0->x;
+ }
+
+ el0->lines[0]->x0 = x0;
+ el0->lines[0]->x1 = x1;
+ }
+
f->w -= mx - d * 2;
f->h += d;