{
intptr_t i;
- __ses_layout_path2(f, path, base);
+ if (path != base) {
+ __ses_layout_path2(f, path, base);
- base = path;
+ base = path;
+ }
if (base->childs) {
for (i = 0; i < base->childs->size; i++) {
if (i >= paths->size)
goto end;
- p = base->pins->data[0];
- n = __ses_find_eline_index(f, p->lid);
- SCF_XCHG(f->elines[n], f->elines[0]);
+ for (j = 0; j < base->pins->size; j += 2) {
+ p = base->pins->data[j];
+
+ n = __ses_find_eline_index(f, p->lid);
+
+ SCF_XCHG(f->elines[n], f->elines[j / 2]);
+ }
- p = base->pins->data[base->pins->size - 1];
+ p = base->pins->data[j - 1];
n = __ses_find_eline_index(f, p->lid);
- SCF_XCHG(f->elines[n], f->elines[f->n_elines - 1]);
+ SCF_XCHG(f->elines[n], f->elines[j / 2 + 1]);
__ses_layout_path(f, base, base);