c->y = cy / 2;
}
- int tx0 = INT_MAX;
- int tx1 = 0;
-
- qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_cx);
-
- for (i = 1; i < f->n_components; i++) {
- c = f->components[i];
- c2 = f->components[i - 1];
-
- int tmp = c->x;
-
- if (c->x > c2->x + d)
- c->x = c2->x + d;
-
- for (k = 0; k < c->n_pins; k++) {
- p1 = c->pins[k];
-
- if (k < 2)
- p1->x = c->x;
- else
- p1->x += c->x - tmp;
- }
- }
-
- qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_id);
-
for (i = 0; i < f->n_elines; i++) {
el = f->elines[i];
p1->x = c->x;
else
p1->x += c->x - tmp;
+ }
+ }
+ }
- if (tx0 > p1->x)
- tx0 = p1->x;
+ int tx0 = INT_MAX;
+ int tx1 = 0;
- if (tx1 < p1->x)
- tx1 = p1->x;
- }
+ qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_cx);
+ for (i = 1; i < f->n_components; i++) {
+ c = f->components[i];
+ c2 = f->components[i - 1];
+
+ int tmp = c->x;
+
+ if (c->x > c2->x + d)
+ c->x = c2->x + d;
+
+ if (c->x < c2->x + d / 2)
+ c->x = c2->x + d / 2;
+
+ for (k = 0; k < c->n_pins; k++) {
+ p1 = c->pins[k];
+
+ if (k < 2)
+ p1->x = c->x;
+ else
+ p1->x += c->x - tmp;
+
+ if (tx0 > p1->x)
+ tx0 = p1->x;
+
+ if (tx1 < p1->x)
+ tx1 = p1->x;
}
}
+ qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_id);
for (i = 0; i < f->n_elines; i++) {
el = f->elines[i];
x1 = p0->x;
}
- el->lines[0]->x0 = x0 - tx0 + d;
- el->lines[0]->x1 = x1 - tx0 + d;
- }
-
- for (i = 0; i < f->n_components; i++) {
- c = f->components[i];
-
- c->x -= tx0 - d;
-
- for (j = 0; j < c->n_pins; j++) {
- p0 = c->pins[j];
- p0->x -= tx0 - d;
- }
+ el->lines[0]->x0 = x0;
+ el->lines[0]->x1 = x1;
}
- f->w = tx1 - tx0 + 2 * d;
+ f->w = tx1 + d;
f->h += d;
scf_loge("f->x: %d, y: %d, w: %d, h: %d, tx0: %d, tx1: %d\n", f->x, f->y, f->w, f->h, tx0, tx1);