From 711756cc173832755e72fbfe590aa51b14570443 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Thu, 5 Oct 2023 00:11:50 +0800 Subject: [PATCH] ses_layout_draw() --- ses_layout.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/ses_layout.c b/ses_layout.c index ebc22e9..a489ba4 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -806,31 +806,20 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_ for (j = 0; j < f->n_elines; j++) { el = f->elines[j]; - cairo_set_source_rgb(cr, 1, 0.5, 0.1); + if (SCF_EDA_PIN_POS & el->flags) + cairo_set_source_rgb(cr, 1, 0, 0); - for (k = 0; k + 1 < el->n_pins; k += 2) { + else if (SCF_EDA_PIN_NEG & el->flags) + cairo_set_source_rgb(cr, 0, 0, 1); - c = f->components[el->pins[k]]; + else if (SCF_EDA_PIN_IN & el->flags) + cairo_set_source_rgb(cr, 0, 1, 0); - p = c->pins[el->pins[k + 1]]; + else if (SCF_EDA_PIN_OUT & el->flags) + cairo_set_source_rgb(cr, 1, 0, 1); + else + cairo_set_source_rgb(cr, 1, 0.5, 0.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, 1, 0, 1); - break; - } - } for (k = 0; k < el->n_lines; k++) { l = el->lines[k]; -- 2.25.1