From: yu.dongliang <18588496441@163.com> Date: Mon, 10 Jul 2023 14:54:20 +0000 (+0800) Subject: battery + -, in out X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=3724eed8fe0148c0efaa1f96b7896592d7ffce48;p=ses.git battery + -, in out --- diff --git a/ses_layout.c b/ses_layout.c index 0d50a4c..84f77f4 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -431,6 +431,30 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_ cairo_set_source_rgb(cr, red, green, blue); + for (k = 0; k + 1 < el->n_pins; k += 2) { + + c = f->components[el->pins[k]]; + + p = c->pins[el->pins[k + 1]]; + + if (SCF_EDA_Battery == c->type) { + + if (SCF_EDA_Battery_POS == p->id) + cairo_set_source_rgb(cr, 1, 0, 0); + else + cairo_set_source_rgb(cr, 0, 0, 1); + break; + + } else if (SCF_EDA_PIN_IN & p->flags) { + cairo_set_source_rgb(cr, 0, 1, 0); + break; + + } else if (SCF_EDA_PIN_OUT & p->flags) { + cairo_set_source_rgb(cr, 0, 0, 0); + break; + } + } + for (k = 0; k < el->n_lines; k++) { l = el->lines[k];