From b35c0708eab74c5ed737cf0f6a2ffd0fcbb7dc56 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Mon, 10 Jul 2023 00:08:54 +0800 Subject: [PATCH] tmp --- main.c | 2 +- ses_layout.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 49e93de..fd2d2bf 100644 --- a/main.c +++ b/main.c @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) ScfEboard* b = scf_eboard__unpack(NULL, len, pb); - ses_layout_board(b, 0, 0, 25, 100); + ses_layout_board(b, 0, 0, 20, 100); #if 0 size_t i; size_t j; diff --git a/ses_layout.c b/ses_layout.c index 8b54228..ee54a77 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -276,11 +276,16 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u return -ENOMEM; l->x0 = bx; - l->y0 = by + (n + j) * d; - l->x1 = l->x0 + w; + l->y0 = by + (n + j) * d; l->y1 = l->y0; - scf_logi("i: %ld, el->id: %ld, j: %ld, n: %ld, y0: %d, w: %d\n", i, el->id, j, n, l->y0, w); + if (w > bw) { + l->x1 = l->x0 + bw; + w -= bw; + } else + l->x1 = l->x0 + w; + + scf_logi("i: %ld, el->id: %ld, j: %ld, n: %ld, y0: %d, x1: %d\n", i, el->id, j, n, l->y0, l->x1); if (scf_eline__add_line(el, l) < 0) { free(l); -- 2.25.1