ses_layout_draw()
authoryu.dongliang <18588496441@163.com>
Wed, 4 Oct 2023 16:11:50 +0000 (00:11 +0800)
committeryu.dongliang <18588496441@163.com>
Wed, 4 Oct 2023 16:11:50 +0000 (00:11 +0800)
ses_layout.c

index ebc22e9f1fed80b33c7a6076814e00d6807c7a39..a489ba49adb707aae3922390178b4c5c27696bb1 100644 (file)
@@ -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];