From: yu.dongliang <18588496441@163.com>
Date: Wed, 4 Oct 2023 16:11:50 +0000 (+0800)
Subject: ses_layout_draw()
X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=711756cc173832755e72fbfe590aa51b14570443;p=ses.git

ses_layout_draw()
---

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];