tmp
authoryu.dongliang <18588496441@163.com>
Sun, 9 Jul 2023 16:08:54 +0000 (00:08 +0800)
committeryu.dongliang <18588496441@163.com>
Sun, 9 Jul 2023 16:08:54 +0000 (00:08 +0800)
main.c
ses_layout.c

diff --git a/main.c b/main.c
index 49e93de126ed2e84cc99af6600cb2b63955507ba..fd2d2bfc3b28cba3197c13d305f5b23b15e0b556 100644 (file)
--- 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;
index 8b54228949e9c8c4da5e1f373f6d555a01c6da07..ee54a776829537a83181b550d9c85d2dc4844055 100644 (file)
@@ -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);