From ce58381efb8edb9d978547e19dd739c5e2f80cda Mon Sep 17 00:00:00 2001
From: "yu.dongliang" <18588496441@163.com>
Date: Sun, 16 Jul 2023 14:50:25 +0800
Subject: [PATCH] ses layout

---
 ses_layout.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/ses_layout.c b/ses_layout.c
index 4c1beb5..85b416f 100644
--- a/ses_layout.c
+++ b/ses_layout.c
@@ -542,6 +542,8 @@ int ses_layout_function(ScfEfunction* f, int d)
 	for (i = 0; i < f->n_elines; i++) {
 		el0       = f->elines[i];
 
+		el0->lines[0]->x1 -= mx;
+
 		for (m = 0; m + 3 < el0->n_pins; m += 2) {
 
 			c0 = f->components[el0->pins[m]];
@@ -577,11 +579,6 @@ int ses_layout_function(ScfEfunction* f, int d)
 		}
 	}
 
-	f->w += d;
-	f->h += d;
-
-	scf_loge("f->x: %d, y: %d, w: %d, h: %d\n", f->x, f->y, f->w, f->h);
-
 	for (i = 0; i < f->n_components; i++) {
 		c0 =        f->components[i];
 
@@ -591,6 +588,8 @@ int ses_layout_function(ScfEfunction* f, int d)
 		for (j = 0; j < c0->n_pins; j++) {
 			p0 =        c0->pins[j];
 
+			p0->x -= mx;
+
 			cx += p0->x;
 			cy += p0->y;
 		}
@@ -599,6 +598,12 @@ int ses_layout_function(ScfEfunction* f, int d)
 		c0->y = cy / c0->n_pins;
 	}
 
+	f->w -= mx;
+	f->w += d;
+	f->h += d;
+
+	scf_loge("f->x: %d, y: %d, w: %d, h: %d, mx: %d\n", f->x, f->y, f->w, f->h, mx);
+
 	return 0;
 }
 
-- 
2.25.1