From: yu.dongliang <18588496441@163.com> Date: Mon, 10 Jul 2023 15:27:08 +0000 (+0800) Subject: tmp X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=cf4108e14cef2a2f1c7731f8edb0b8acc21219a7;p=ses.git tmp --- diff --git a/ses_layout.c b/ses_layout.c index 84f77f4..14b2e20 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -303,10 +303,23 @@ int __ses_layout_function(ScfEfunction* f, ScfEline* el, size_t* pn, uint32_t d, if (el2->id == ec->lid && 0 == el2->n_lines) { + int diff = 5 + rand() % 10; + + bx += diff; + bw -= diff; + ret = __ses_layout_function(f, el2, pn, d, bx, by, bw, bh); if (ret < 0) return ret; + if (i == el->n_conns / 2) { + uint32_t tmp = el ->lines[0]->y0; + el ->lines[0]->y0 = el2->lines[0]->y0; + el2->lines[0]->y0 = tmp; + + el ->lines[0]->y1 = el ->lines[0]->y0; + el2->lines[0]->y1 = el2->lines[0]->y0; + } break; } } @@ -345,6 +358,11 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u int ret = __ses_layout_function(f, el, &n, d, bx, by, bw, bh); if (ret < 0) return ret; + + int diff = 5 + rand() % 10; + + bx += diff; + bw -= diff; } } scf_logi("f->x: %d, f->y: %d, f->w: %d, f->h: %d\n", f->x, f->y, f->w, f->h); @@ -380,7 +398,7 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u m = j * d % f->w; assert(m < l->x1); - p->x = l->x1 - m; + p->x = l->x0 + m; p->y = l->y0; } }