← Back to team overview

kicad-developers team mailing list archive

Corruption when moving pins in library editor

 

Hi,

Every time I move a pin in the library editor I end up with a different
color artifact of the pin text in the old position. I took a look
tonight and I notice we are clearing the old text by XOR'ing with
the pin color, not the pin text color.

The following patch fixes it for me. Instead of passing down the pin
color, we just look up the colors from the pin name and pin number
layers.		

Anton

Index: b/eeschema/lib_pin.cpp
===================================================================
--- a/eeschema/lib_pin.cpp
+++ b/eeschema/lib_pin.cpp
@@ -832,7 +832,7 @@ void LIB_PIN::drawGraphic( EDA_DRAW_PANE
     {
         DrawPinTexts( aPanel, aDC, pos1, orient, Entry->GetPinNameOffset(),
                       Entry->ShowPinNumbers(), Entry->ShowPinNames(),
-                      aColor, aDrawMode );
+                      aDrawMode );
     }
 
     /* Set to one (1) to draw bounding box around pin to validate bounding
@@ -1069,7 +1069,6 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PAN
                             int             TextInside,
                             bool            DrawPinNum,
                             bool            DrawPinName,
-                            EDA_COLOR_T     Color,
                             GR_DRAWMODE     DrawMode )
 {
     int         x, y, x1, y1;
@@ -1087,12 +1086,8 @@ void LIB_PIN::DrawPinTexts( EDA_DRAW_PAN
 
     GRSetDrawMode( DC, DrawMode );
 
-    /* Get the num and name colors */
-    if( (Color < 0) && IsSelected() )
-        Color = GetItemSelectedColor();
-
-    NameColor = (EDA_COLOR_T) ( Color == -1 ? ReturnLayerColor( LAYER_PINNAM ) : Color );
-    NumColor  = (EDA_COLOR_T) ( Color == -1 ? ReturnLayerColor( LAYER_PINNUM ) : Color );
+    NameColor = ReturnLayerColor( LAYER_PINNAM );
+    NumColor  = ReturnLayerColor( LAYER_PINNUM );
 
     /* Create the pin num string */
     ReturnPinStringNum( StringPinNum );
Index: b/eeschema/lib_pin.h
===================================================================
--- a/eeschema/lib_pin.h
+++ b/eeschema/lib_pin.h
@@ -371,7 +371,7 @@ public:
      */
     void DrawPinTexts( EDA_DRAW_PANEL* aPanel, wxDC* aDC, wxPoint& aPosition,
                        int aOrientation, int TextInside, bool DrawPinNum, bool DrawPinName,
-                       EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode );
+                       GR_DRAWMODE aDrawMode );
 
     /**
      * Function PlotPinTexts