Fix pin drawing after removal of upside-down coords.

This commit is contained in:
Jeff Young 2024-04-28 15:24:19 +01:00
parent 67737ea0b2
commit 352463dfeb
3 changed files with 23 additions and 20 deletions

View File

@ -75,13 +75,11 @@ enum class GRAPHIC_PINSHAPE
* The symbol library pin object orientations.
*/
enum class PIN_ORIENTATION {
PIN_RIGHT = 'R',
PIN_LEFT = 'L',
PIN_UP = 'U',
PIN_DOWN = 'D',
LAST_OPTION = PIN_DOWN,
INHERIT = 'I'
PIN_RIGHT,
PIN_LEFT,
PIN_UP,
PIN_DOWN,
INHERIT
};

View File

@ -851,6 +851,11 @@ void SCH_PAINTER::drawPinDanglingIndicator( const VECTOR2I& aPos, const COLOR4D&
void SCH_PAINTER::draw( const SCH_PIN* aPin, int aLayer, bool aDimmed )
{
// Don't draw pins from a selection view-group. Pins in a schematic must always be drawn
// from their parent symbol's m_part.
if( dynamic_cast<const SCH_SYMBOL*>( aPin->GetParentSymbol() ) )
return;
if( !isUnitAndConversionShown( aPin ) )
return;

View File

@ -1486,19 +1486,6 @@ void SCH_PIN::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
if( dynamic_cast<LIB_SYMBOL*>( GetParentSymbol() ) )
{
if( aRotateCCW )
{
RotatePoint( m_position, aCenter, -ANGLE_90 );
switch( GetOrientation() )
{
default:
case PIN_ORIENTATION::PIN_RIGHT: m_orientation = PIN_ORIENTATION::PIN_DOWN; break;
case PIN_ORIENTATION::PIN_UP: m_orientation = PIN_ORIENTATION::PIN_RIGHT; break;
case PIN_ORIENTATION::PIN_LEFT: m_orientation = PIN_ORIENTATION::PIN_UP; break;
case PIN_ORIENTATION::PIN_DOWN: m_orientation = PIN_ORIENTATION::PIN_LEFT; break;
}
}
else
{
RotatePoint( m_position, aCenter, ANGLE_90 );
@ -1511,6 +1498,19 @@ void SCH_PIN::Rotate( const VECTOR2I& aCenter, bool aRotateCCW )
case PIN_ORIENTATION::PIN_DOWN: m_orientation = PIN_ORIENTATION::PIN_RIGHT; break;
}
}
else
{
RotatePoint( m_position, aCenter, -ANGLE_90 );
switch( GetOrientation() )
{
default:
case PIN_ORIENTATION::PIN_RIGHT: m_orientation = PIN_ORIENTATION::PIN_DOWN; break;
case PIN_ORIENTATION::PIN_UP: m_orientation = PIN_ORIENTATION::PIN_RIGHT; break;
case PIN_ORIENTATION::PIN_LEFT: m_orientation = PIN_ORIENTATION::PIN_UP; break;
case PIN_ORIENTATION::PIN_DOWN: m_orientation = PIN_ORIENTATION::PIN_LEFT; break;
}
}
}
}