← Back to team overview

kicad-developers team mailing list archive

eeschema: Wire label text

 

I need horizontal left and right aligned type of wire label.
But now "Left" label is just rotated "Right". 
I have no idea how to use it.
I prefer something like Global label. 
So I decided to bring wire label style into line with Global label one.

Here is the patch:

--- class_text-label.cpp.orig 2008-01-16 13:20:21.000000000 +0900
+++ class_text-label.cpp 2008-01-20 10:05:16.000000000 +0900
@@ -187,7 +187,49 @@
int DrawMode, int Color )
/*********************************************************************************************/
{
- DrawTextStruct::Draw( panel, DC, offset, DrawMode, Color );
+ int color;
+ int width = MAX( m_Width, g_DrawMinimunLineWidth );
+
+ if( Color >= 0 )
+ color = Color;
+ else
+ color = ReturnLayerColor( m_Layer );
+
+ GRSetDrawMode( DC, DrawMode );
+
+ switch( m_Orient )
+ {
+ case 0: /* Orientation horiz normale */
+ DrawGraphicText( panel, DC,
+ wxPoint( m_Pos.x + offset.x, m_Pos.y -
TXTMARGE + offset.y ),
+ color, m_Text, TEXT_ORIENT_HORIZ, m_Size,
+ GR_TEXT_HJUSTIFY_LEFT,
GR_TEXT_VJUSTIFY_BOTTOM, width );
+ break;
+
+ case 1: /* Orientation vert UP */
+ DrawGraphicText( panel, DC,
+ wxPoint( m_Pos.x - TXTMARGE + offset.x,
m_Pos.y + offset.y ),
+ color, m_Text, TEXT_ORIENT_VERT, m_Size,
+ GR_TEXT_HJUSTIFY_RIGHT,
GR_TEXT_VJUSTIFY_BOTTOM, width );
+ break;
+
+ case 2: /* Orientation horiz inverse */
+ DrawGraphicText( panel, DC,
+ wxPoint( m_Pos.x + offset.x, m_Pos.y -
TXTMARGE + offset.y ),
+ color, m_Text, TEXT_ORIENT_HORIZ, m_Size,
+ GR_TEXT_HJUSTIFY_RIGHT,
GR_TEXT_VJUSTIFY_BOTTOM, width );
+ break;
+
+ case 3: /* Orientation vert BOTTOM */
+ DrawGraphicText( panel, DC,
+ wxPoint( m_Pos.x - TXTMARGE + offset.x,
m_Pos.y + offset.y ),
+ color, m_Text, TEXT_ORIENT_VERT, m_Size,
+ GR_TEXT_HJUSTIFY_RIGHT,
GR_TEXT_VJUSTIFY_TOP, width );
+ break;
+ }
+
+ if( m_IsDangling )
+ DrawDanglingSymbol( panel, DC, m_Pos + offset, color );
}

Any suggestions?

Andrey