예제 #1
0
void SCH_TEXT::Rotate( wxPoint aPosition )
{
    int dy;

    wxPoint pt = GetTextPos();
    RotatePoint( &pt, aPosition, 900 );
    SetTextPos( pt );

    int spin = GetLabelSpinStyle();

    // Global and hierarchical labels spin backwards.  Fix here because
    // changing SetLabelSpinStyle would break existing designs.
    if( this->Type() == SCH_GLOBAL_LABEL_T || this->Type() == SCH_HIERARCHICAL_LABEL_T )
        SetLabelSpinStyle( ( spin - 1 >= 0 ? ( spin - 1 ) : 3 ) );
    else
        SetLabelSpinStyle( ( spin + 1 ) % 4 );

    if( this->Type() == SCH_TEXT_T )
    {
        switch( GetLabelSpinStyle() )
        {
        case 0:  dy = GetTextHeight(); break;     // horizontal text
        case 1:  dy = 0;               break;     // Vert Orientation UP
        case 2:  dy = GetTextHeight(); break;     // invert horizontal text
        case 3:  dy = 0;               break;     // Vert Orientation BOTTOM
        default: dy = 0;               break;
        }

        SetTextY( GetTextPos().y + dy );
    }
}
예제 #2
0
void SCH_TEXT::MirrorX( int aXaxis_position )
{
    // Text is NOT really mirrored; it is moved to a suitable vertical position
    switch( GetLabelSpinStyle() )
    {
    default:
    case 0:                         break;  // horizontal text
    case 1: SetLabelSpinStyle( 3 ); break;  // Vert Orientation UP
    case 2:                         break;  // invert horizontal text
    case 3: SetLabelSpinStyle( 1 ); break;  // Vert Orientation BOTTOM
    }

    SetTextY( Mirror( GetTextPos().y, aXaxis_position ) );
}
예제 #3
0
void SCH_TEXT::MirrorY( int aYaxis_position )
{
    // Text is NOT really mirrored; it is moved to a suitable horizontal position
    switch( GetLabelSpinStyle() )
    {
    default:
    case 0: SetLabelSpinStyle( 2 ); break;  // horizontal text
    case 1:                         break;  // Vert Orientation UP
    case 2: SetLabelSpinStyle( 0 ); break;  // invert horizontal text
    case 3:                         break;  // Vert Orientation BOTTOM
    }

    SetTextX( Mirror( GetTextPos().x, aYaxis_position ) );
}
예제 #4
0
void SCH_SHEET_PIN::SetEdge( SCH_SHEET_PIN::SHEET_SIDE aEdge )
{
    SCH_SHEET* Sheet = GetParent();

    // use SHEET_UNDEFINED_SIDE to adjust text orientation without changing edge

    switch( aEdge )
    {
    case SHEET_LEFT_SIDE:
        m_edge = aEdge;
        SetTextX( Sheet->m_pos.x );
        SetLabelSpinStyle( 2 ); // Orientation horiz inverse
        break;

    case SHEET_RIGHT_SIDE:
        m_edge = aEdge;
        SetTextX( Sheet->m_pos.x + Sheet->m_size.x );
        SetLabelSpinStyle( 0 ); // Orientation horiz normal
        break;

    case SHEET_TOP_SIDE:
        m_edge = aEdge;
        SetTextY( Sheet->m_pos.y );
        SetLabelSpinStyle( 3 ); // Orientation vert BOTTOM
        break;

    case SHEET_BOTTOM_SIDE:
        m_edge = aEdge;
        SetTextY( Sheet->m_pos.y + Sheet->m_size.y );
        SetLabelSpinStyle( 1 ); // Orientation vert UP
        break;

    default:
        break;
    }
}