From: yu.dongliang <18588496441@163.com> Date: Thu, 13 Jul 2023 10:00:39 +0000 (+0800) Subject: ses layout X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=8f41f3af089ec7ca2dbac97008b3d42c90f10b36;p=ses.git ses layout --- diff --git a/ses_layout.c b/ses_layout.c index 1ba003a..862e257 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -417,14 +417,20 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u p0 = c->pins[el0->pins[m + 1]]; p1 = c->pins[el1->pins[n + 1]]; - p0->x = el0->lines[0]->x1 + j * d; - p0->y = el0->lines[0]->y0; + if (SCF_EDA_Battery == c->type) { - p1->x = el1->lines[0]->x1 + j * d; - p1->y = el1->lines[0]->y0; + p0->x = el0->lines[0]->x0; + p1->x = el1->lines[0]->x0; + } else { + p0->x = el0->lines[0]->x1 + j * d; + p1->x = el1->lines[0]->x1 + j * d; - el0->lines[0]->x1 += j * d; - el1->lines[0]->x1 += j * d; + el0->lines[0]->x1 += j * d; + el1->lines[0]->x1 += j * d; + } + + p0->y = el0->lines[0]->y0; + p1->y = el1->lines[0]->y0; if (f->w < el0->lines[0]->x1 - f->x) f->w = el0->lines[0]->x1 - f->x; @@ -448,10 +454,14 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u p0 = c->pins[el0->pins[m + 1]]; if (0 == p0->x) { - p0->x = el0->lines[0]->x1 + d; - p0->y = el0->lines[0]->y1; - el0->lines[0]->x1 += d; + if (SCF_EDA_Battery == c->type) + p0->x = el0->lines[0]->x0; + else { + p0->x = el0->lines[0]->x1 + d; + el0->lines[0]->x1 += d; + } + p0->y = el0->lines[0]->y1; if (f->w < el0->lines[0]->x1 - f->x) f->w = el0->lines[0]->x1 - f->x; @@ -785,7 +795,7 @@ int ses_layout_board(ScfEboard* b, uint32_t x, uint32_t y, uint32_t w, uint32_t ses_lines_same_components(f); - int ret = ses_layout_function(f, 30, x + 30, y + 30, w - 40, h - 40); + int ret = ses_layout_function(f, 50, x + 50, y + 50, w - 50, h - 50); if (ret < 0) { scf_loge("\n"); return ret;