From: yu.dongliang <18588496441@163.com> Date: Sun, 16 Jul 2023 10:50:16 +0000 (+0800) Subject: ses_layout_function X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=10fb24ca8d0703cf56b49dffb51f4758f955f121;p=ses.git ses_layout_function --- diff --git a/ses_layout.c b/ses_layout.c index c528d01..67d5269 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -498,12 +498,27 @@ int ses_layout_function(ScfEfunction* f, int d) p2 = c1->pins[ el0->pins[n + 1]]; p3 = c1->pins[!el0->pins[n + 1]]; - if ((p1->y < p0->y && p3->y < p0->y) - || (p1->y > p0->y && p3->y > p0->y)) { + if (p1->y < p0->y && p3->y < p0->y) { - if ((p0->x > p2->x && p1->x < p3->x) - || (p0->x < p2->x && p1->x > p3->x)) - SCF_XCHG(p0->x, p2->x); + if (p0->x > p2->x) { + + if (p1->x < p3->x || p1->y > p3->y) + SCF_XCHG(p0->x, p2->x); + + } else { + if (p1->x > p3->x || p1->y < p3->y) + SCF_XCHG(p0->x, p2->x); + } + + } else if (p1->y > p0->y && p3->y > p0->y) { + + if (p0->x > p2->x) { + if (p1->x < p3->x || p1->y < p3->y) + SCF_XCHG(p0->x, p2->x); + } else { + if (p1->x > p3->x || p1->y > p3->y) + SCF_XCHG(p0->x, p2->x); + } } } }