← Back to team overview

kicad-developers team mailing list archive

Label selection patch

 

Hi,

I was having a problem selecting a global label near a component. I've
uploaded an example case to
http://img441.imageshack.us/img441/8088/kicad.png. It is impossible to move
the +5V label since it cannot be selected. The component next to it is
always selected instead. It seems that SchematicGeneralLocateAndDisplay in
controle.cpp does not do what is written in the comments about selection
priorities. Something along the lines of the following patch seems to fix
the problem:

=====================

--- kicad-bzr/eeschema/controle.cpp    2010-07-15 16:45:18.000000000 +0300
+++ kicad/eeschema/controle.cpp    2010-07-15 17:06:00.000000000 +0300
@@ -175,6 +175,13 @@
         return DrawStruct;
     }

+    DrawStruct = (SCH_ITEM*) PickStruct( refpoint, GetScreen(), LABELITEM
);
+    if( DrawStruct )
+    {
+        ClearMsgPanel();
+        return DrawStruct;
+    }
+
     /* search for a pin */
     Pin = LocateAnyPin( (SCH_ITEM*) m_CurrentSheet->LastDrawList(),
refpoint,
                         &LibItem );

=====================

Regards,

Marco

Follow ups