Move sheet pins in front of sheetedge & move them in by ½ line width

This commit is contained in:
Frank Severinsen 2018-12-14 00:04:49 +01:00 committed by Jeff Young
parent c437ca1640
commit e2ed0e6557
3 changed files with 23 additions and 4 deletions

View File

@ -1265,13 +1265,30 @@ void SCH_PAINTER::draw( SCH_SHEET *aSheet, int aLayer )
text = wxT( "File: " ) + aSheet->GetFileName();
m_gal->StrokeText( text, pos_filename, nameAngle );
}
else if( aLayer == LAYER_HIERLABEL )
{
for( auto& sheetPin : aSheet->GetPins() )
{
if( !sheetPin.IsMoving() )
{
int width = aSheet->GetPenSize();
wxPoint pt = sheetPin.GetTextPos();
switch( sheetPin.GetEdge() )
{
case SCH_SHEET_PIN::SHEET_TOP_SIDE: pt.y -= width / 2; break;
case SCH_SHEET_PIN::SHEET_BOTTOM_SIDE: pt.y += width / 2; break;
case SCH_SHEET_PIN::SHEET_RIGHT_SIDE: pt.x -= width / 2; break;
case SCH_SHEET_PIN::SHEET_LEFT_SIDE: pt.x += width / 2; break;
default: break;
}
sheetPin.SetTextPos(pt);
draw( static_cast<SCH_HIERLABEL*>( &sheetPin ), aLayer );
}
}
}
}

View File

@ -426,9 +426,10 @@ wxPoint SCH_SHEET::GetFileNamePosition()
void SCH_SHEET::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 2;
aLayers[0] = LAYER_SHEET;
aLayers[1] = LAYER_SHEET_BACKGROUND;
aCount = 3;
aLayers[0] = LAYER_HIERLABEL;
aLayers[1] = LAYER_SHEET;
aLayers[2] = LAYER_SHEET_BACKGROUND;
}

View File

@ -46,6 +46,7 @@ static const LAYER_NUM SCH_LAYER_ORDER[] =
LAYER_ERC_ERR, LAYER_ERC_WARN,
LAYER_REFERENCEPART, LAYER_VALUEPART, LAYER_FIELDS,
LAYER_JUNCTION, LAYER_NOCONNECT,
LAYER_HIERLABEL,
LAYER_WIRE, LAYER_BUS,
LAYER_DEVICE,
LAYER_DEVICE_BACKGROUND,