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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user