7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Fix positions of popup menus when plotting in mirrored mode.

[Resolve conflicts with JP's fix to same.  I'm not sure if we support !m_mirrorIsHorizontal, but
it was in other code, so I left it in just to be
safe....]

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19717
This commit is contained in:
Jeff Young 2025-01-23 10:53:29 +00:00
parent 48b32f781e
commit a9ddcf4287
3 changed files with 17 additions and 12 deletions

View File

@ -777,15 +777,19 @@ void PDF_PLOTTER::ClosePage()
auto iuToPdfUserSpace =
[&]( const VECTOR2I& aCoord ) -> VECTOR2D
{
VECTOR2D retval = VECTOR2D( aCoord ) * PTsPERMIL / ( m_IUsPerDecimil * 10 );
VECTOR2D pos = VECTOR2D( aCoord ) * PTsPERMIL / ( m_IUsPerDecimil * 10 );
// PDF y=0 is at bottom of page, invert coordinate
retval.y = psPaperSize.y - retval.y;
VECTOR2D retval( pos.x, psPaperSize.y - pos.y );
// The pdf plot can be mirrored (from left to right). So mirror the
// x coordinate if m_plotMirror is set
if( m_plotMirror )
{
retval.x = ( psPaperSize.x - retval.x );
if( m_mirrorIsHorizontal )
retval.x = ( psPaperSize.x - pos.x );
else
retval.y = pos.y;
}
return retval;

View File

@ -1326,17 +1326,19 @@ void SCH_LABEL_BASE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_O
if( connection )
{
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), _( "Net" ),
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
_( "Net" ),
connection->Name() ) );
properties.emplace_back(
wxString::Format( wxT( "!%s = %s" ), _( "Resolved netclass" ),
GetEffectiveNetClass()->GetHumanReadableName() ) );
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
_( "Resolved netclass" ),
GetEffectiveNetClass()->GetHumanReadableName() ) );
}
for( const SCH_FIELD& field : GetFields() )
{
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ), field.GetName(),
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
field.GetName(),
field.GetShownText( false ) ) );
}

View File

@ -881,9 +881,9 @@ void SCH_LINE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& a
_( "Net" ),
connection->Name() ) );
properties.emplace_back(
wxString::Format( wxT( "!%s = %s" ), _( "Resolved netclass" ),
GetEffectiveNetClass()->GetHumanReadableName() ) );
properties.emplace_back( wxString::Format( wxT( "!%s = %s" ),
_( "Resolved netclass" ),
GetEffectiveNetClass()->GetHumanReadableName() ) );
}
}
else if( GetLayer() == LAYER_BUS )
@ -893,7 +893,6 @@ void SCH_LINE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& a
for( const std::shared_ptr<SCH_CONNECTION>& member : connection->Members() )
properties.emplace_back( wxT( "!" ) + member->Name() );
}
}
if( !properties.empty() )